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

Environment rendering pass #230

Merged
merged 13 commits into from
May 1, 2020
Merged

Conversation

cgphilipp
Copy link
Collaborator

@cgphilipp cgphilipp commented Feb 26, 2020

This adds an EnvironmentRenderingPass, which renders four types of environment textures types via an ndc triangle.
includes #244, merge after that one
closes #114

@coveralls
Copy link

coveralls commented Feb 26, 2020

Coverage Status

Coverage decreased (-0.3%) to 17.614% when pulling f01217a on p-otto:env-mapping-pass into 40a4968 on cginternals:master.

@cgphilipp
Copy link
Collaborator Author

@cgcostume While working on this, I found out that we are handling cubemap faces in an incorrect way. The +x, -x, +z and -z faces have an inverted Y coordinate in comparison to the usual WebGL way of handling texture mapping: https://www.khronos.org/opengl/wiki/Cubemap_Texture#Upload_and_orientation

Currently we are implicitly flipping all faces in TextureCube::fetch, however this results in the wrong orientation in the X axis. To be correct, we would need to instead rotate all faces by 180°.
This is currently worked around in the envmapping example with a ray.x *= -1.0, but when implementing reflections using cubemaps this workaround is kind of counter intuitive.

One way to fix this is to perform the 180° rotation either in ERMT or during loading cubemaps in webgl-operate. How should we proceed here?

@cgcostume
Copy link
Member

cgcostume commented Feb 27, 2020

  • ermt should display the textures as it is implemented now,so -x +z +x -z should always be visible like this.
  • ermt should export the textures as described by khronos
  • webgl-operate should import as is, since it's assumed to be already correct
  • our shaders used for env mapping should be adjusted/fixed accordingly

@cgcostume
Copy link
Member

@p-otto what's your opinion on this?

@cgphilipp
Copy link
Collaborator Author

@cgcostume Sounds good, maybe we can later add an export option for ERMT to target either WebGL or other tools/APIs that use the conventional format.

@cgcostume cgcostume merged commit 73d9e0a into cginternals:master May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integrate common environment mapping techniques
3 participants