Wrong Dynamic Light cast on a model (Cube)

Bugs that have been investigated and resolved somehow.

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.
Post Reply
XxMiltenXx
Posts: 219
Joined: Wed Jan 08, 2014 8:40 am
Graphics Processor: nVidia with Vulkan support
Location: Germany

Wrong Dynamic Light cast on a model (Cube)

Post by XxMiltenXx »

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:
BlenderOpenGL.png
Here's how it looks when fixed with Npherno's MD3 Compiler:
OpenGL.png
In Truecolor SW Render it looks more correct, even though the model is a bit too bright:
SW Truecolor.png
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?
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Wrong Dynamic Light cast on a model (Cube)

Post by dpJudas »

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.
XxMiltenXx
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)

Post by XxMiltenXx »

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.
NotAttenuated.png
Test file here:
ModelLightBugNA.pk3
(11.63 KiB) Downloaded 25 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
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)

Post by Graf Zahl »

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.
XxMiltenXx
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)

Post by XxMiltenXx »

Understood, thanks.
Post Reply

Return to “Closed Bugs [GZDoom]”