Wrong Dynamic Light cast on a model (Cube)

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Wrong Dynamic Light cast on a model (Cube)

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

by XxMiltenXx » Mon May 06, 2019 1:51 pm

Understood, thanks.

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

by Graf Zahl » Mon May 06, 2019 11:44 am

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.

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

by XxMiltenXx » Mon May 06, 2019 10: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 26 times

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

by dpJudas » Mon May 06, 2019 9: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.

Wrong Dynamic Light cast on a model (Cube)

by XxMiltenXx » Mon May 06, 2019 7: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?

Top