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

ShadowTutorial: glTexImage2D depthTexture, wrong internal format #81

Open
Gustl22 opened this issue Dec 25, 2018 · 0 comments
Open

ShadowTutorial: glTexImage2D depthTexture, wrong internal format #81

Gustl22 opened this issue Dec 25, 2018 · 0 comments

Comments

@Gustl22
Copy link

Gustl22 commented Dec 25, 2018

I'm not sure, but maybe this should look like this:

glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, 1024, 1024, 0,GL_DEPTH_COMPONENT, GL_FLOAT, 0);

or

glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, 1024, 1024, 0,GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0);

I used your code for an Android project and in OpenGL ES 3.0 the depth texture didn't work until I changed it. I'm very new in OpenGL, but maybe this is helpful.

References:
https://www.khronos.org/opengl/wiki/Common_Mistakes#Depth_Buffer_Precision
https://www.khronos.org/opengl/wiki/Image_Format#Depth_formats
https://stackoverflow.com/questions/37071584/opengl-fbo-depth-format-and-type-confusion

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

No branches or pull requests

1 participant