[Not GZDoom] Wrong Dynamic Light cast on a model (Cube)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Wrong Dynamic Light cast on a model (Cube)

Postby XxMiltenXx » Mon May 06, 2019 8:23 am

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?
XxMiltenXx
 
Joined: 08 Jan 2014
Location: Germany
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby dpJudas » Mon May 06, 2019 10:22 am

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.
dpJudas
 
 
 
Joined: 28 May 2016

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

Postby XxMiltenXx » Mon May 06, 2019 11:32 am

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 9 times
XxMiltenXx
 
Joined: 08 Jan 2014
Location: Germany
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Mon May 06, 2019 12:44 pm

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby XxMiltenXx » Mon May 06, 2019 2:51 pm

Understood, thanks.
XxMiltenXx
 
Joined: 08 Jan 2014
Location: Germany
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests