Godot: SurfaceTool::add_normal() doesn't normalize, while ImmediateGeometry::set_normal() does

Created on 6 Jan 2019  路  2Comments  路  Source: godotengine/godot

Godot version:
3.1 Alpha 5

Issue description:
Used both SurfaceTool and ImmediateGeometry to render the same geometry. But forgot to normalize my normals. Resulting renders differ from each other in brightness, because only ImmediateGeometry normalized my given normals.

More information:
https://www.reddit.com/r/godot/comments/ad0eqe/immediategeometry_renders_differently_from_a/

bug core rendering

Most helpful comment

In my opinion neither should automatically normalize or modify any passed values (if that happens now). In customized shaders people often use normals and texture uv's to pass custom data and modifying it in any way could break things and prevent these kinds of often very useful tricks.

All 2 comments

Might be by design but inconsistencies like this one could cause a lot of confusion to unknowing users.

In my opinion neither should automatically normalize or modify any passed values (if that happens now). In customized shaders people often use normals and texture uv's to pass custom data and modifying it in any way could break things and prevent these kinds of often very useful tricks.

Was this page helpful?
0 / 5 - 0 ratings