mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

GENERATE_NORMALS generates completely useless normals

Open Einheit-101 opened this issue 2 years ago • 5 comments

Describe the bug

Recently i tried this HLSL value and the result is bad. I dont know if this can even be fixed but in its current state GENERATE_NORMALS is literally useless:

https://imgur.com/a/CsVJDTL

Steps to reproduce

  1. Export a model with vertex prelight and vertex color (Doing so will export the model without vertex normals due to DFF limitation)
  2. Replace any object
  3. Apply a dynamic lighting shader to that object that uses normals to calculate the light, it will be completely screwed

Version

Multi Theft Auto v1.5.9-release-21166

Additional context

No response

Relevant log output

No response

Security Policy

  • [X] I have read and understood the Security Policy and this issue is not security related.

Einheit-101 avatar Apr 26 '22 02:04 Einheit-101

It doesn't generate any normals, takes them from model, if they are not present normals will be 0,0,0

borsuczyna avatar Apr 27 '22 10:04 borsuczyna

How is it possible that there are no normals? The faces must face in a direction. It should take these values. What it currently does looks like fully random.

Einheit-101 avatar Apr 27 '22 11:04 Einheit-101

https://github.com/multitheftauto/mtasa-blue/blob/16769b8d1c94e2b9fe6323dcba46d1305f87a190/Client/core/CAdditionalVertexStreamManager.cpp#L105-L128

CheckCanDoThis looks like reason of this

borsuczyna avatar Apr 27 '22 13:04 borsuczyna

It seems that the normal handling needs improvement and this solution has been made transitional only as long as there is nothing better available

Einheit-101 avatar Apr 27 '22 13:04 Einheit-101

It doesn't generate any normals, takes them from model, if they are not present normals will be 0,0,0

That is not true. See CAdditionalVertexStreamManager::UpdateAdditionalStreamContent

tederis avatar May 03 '22 02:05 tederis