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

envMap automatic MIP level (HLSL Only) #154

Merged

Conversation

shadielhajj
Copy link
Collaborator

@shadielhajj shadielhajj commented Jul 6, 2024

Changed the envMap cubmap texture type declaration from the obsolete DirectX 9 (2002) syntax to the newer DirectX 11 (2009) syntax.

This requires clients to update the cubemap declaration on their end from
samplerCUBE _Cube;
to
TextureCube _Cube;
SamplerState sampler_Cube;

This allows us to query the TextureCube object for the max Mip Level.

Currently Lygia assumes a default ENVMAP_MAX_MIP_LEVEL of 3, which is:

  1. Dependent on the resolution of the texture
  2. Very low for typical 2k cubemap textures.

This results in cubemaps not being sufficiently blurred when using rough materials.
The new system is resolution independent and guarantees correct blurring levels.

ENVMAP_MAX_MIP_LEVEL can still be used to override the automatic setting if desired.

mip level

@patriciogonzalezvivo patriciogonzalezvivo merged commit 9429528 into patriciogonzalezvivo:main Jul 6, 2024
@shadielhajj shadielhajj deleted the feature/envmap branch July 6, 2024 21:55
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.

2 participants