So, here's the issue.
I made a simple cube model (exported from Blender with the Blender exporter from the duke4.net forums) and I noticed some issues with the normals. So I asked around for some help, and someone recommended Npherno's MD3 Compiler, which can fix MD3 models. I did recalculate the normals, but in GZDoom it's still not correct.
Here is how the model looks exported from Blender:
Here's how it looks when fixed with Npherno's MD3 Compiler:
In Truecolor SW Render it looks more correct, even though the model is a bit too bright:
A test example is here: https://www.dropbox.com/s/pfx4aprorj5x3 ... g.pk3?dl=0
Unless the normals are still wrong, I am really at a loss at what's wrong here. So is this a bug or an engine limitation?
Wrong Dynamic Light cast on a model (Cube)
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
-
- Posts: 219
- Joined: Wed Jan 08, 2014 8:40 am
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: Wrong Dynamic Light cast on a model (Cube)
I tested your map using gl_ssao_debug 4, which shows the normal vectors:
A similar screenshot from Gene Tech looks like this:
As you can see the normals are clearly wrong on your picture. They seems to be correct in Gene Tech however, so I am not sure this is an engine bug. Maybe your model uses bad smoothing groups that causes it to try bend normals around the cube.
A similar screenshot from Gene Tech looks like this:
As you can see the normals are clearly wrong on your picture. They seems to be correct in Gene Tech however, so I am not sure this is an engine bug. Maybe your model uses bad smoothing groups that causes it to try bend normals around the cube.
-
- Posts: 219
- Joined: Wed Jan 08, 2014 8:40 am
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: Wrong Dynamic Light cast on a model (Cube)
Thanks for the hint with the smoothing... I finally got it fixed - the Problem was that in Blender "smooth faces" was enabled. After setting it to "flat, then fixing the model normals with the Npherno's MD3 Compiler fixed the issue in the given case. However, there seems to be an issue after all:
It only works correctly for attenuated lights, as you can see on the left models. On the right, it seems that the not-attenuated light is applied attenuated to the model. Test file here:
It only works correctly for attenuated lights, as you can see on the left models. On the right, it seems that the not-attenuated light is applied attenuated to the model. Test file here:
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49066
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Wrong Dynamic Light cast on a model (Cube)
All light on models is attenuated - otherwise it would look like crap on real models that have an actual shape.
If you need flat models being integrated into map geometry, don't use unattenuated lights.
If you need flat models being integrated into map geometry, don't use unattenuated lights.
-
- Posts: 219
- Joined: Wed Jan 08, 2014 8:40 am
- Graphics Processor: nVidia with Vulkan support
- Location: Germany
Re: Wrong Dynamic Light cast on a model (Cube)
Understood, thanks.