Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Geometry and Texture Coordinate nodes for world shaders #2356

Merged
merged 3 commits into from
Oct 6, 2021

Conversation

MoritzBrueckner
Copy link
Collaborator

@MoritzBrueckner MoritzBrueckner commented Oct 5, 2021

Requires armory3d/iron#140.

The world normals in Armory were the opposite of how Blender works (which is actually the correct way), the zenith had normals (0, 0, 1) which rather is the position of the zenith but not its normal vector (0, 0, -1). This resulted in worlds looking different than in Blender if the Geometry node was used. Now there is a differentiation between normals and position and all usages should be updated accordingly. Tested it with both sky types, clouds, environment maps and all outputs of the Texture Coordinate and Geometry nodes.

Also fixed in the Geometry node:

  • Tangent, Incoming and Backfacing outputs in world shaders
  • Added fake support for the new Random Per Island output (Cycles only, so it just returns 0.0 like in Eevee)

Fixed in the Texture Coordinate node:

  • The UV output now outputs (0,0,0) like in Blender, before it was (1,0,0).
  • The Reflection output returns the normals like in Blender

Still not correct: the Camera output in the Texture Coordinate node doesn't work and just outputs (0,0,0) and the Window output is the wrong way around (might be DirectX only, I can't test html5 right now due to a bug).

@luboslenco Maybe the environment map coords of ArmorPaint worlds need to be updated if the linked Iron PR is merged.

@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Oct 5, 2021
@luboslenco luboslenco merged commit b9a220f into armory3d:master Oct 6, 2021
@MoritzBrueckner MoritzBrueckner deleted the fix-world-geometry branch October 6, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants