Skip to main content
gamedev.net
🔒 Locked

Linear filtered depth maps

Started by AzureRain 0 replies 550+ views
Original Post
AzureRain
AzureRain
Hi, I'm using linear filtered depth maps in CG and OpenGL to create shadows for my scene. In addition to doing a shadow comparison with tex2DProj, I want to sample the shadow map for its depth, but because I use (GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE), it automatically does the shadow comparison, returning me 0s and 1s when what I want is interpolated values in [0, 1]. How do I do a depth lookup bypassing the shadow comparison? My texture setup is here glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); Thanks in advance!
http://fashionhangover.blogspot.com
zedz
zedz
GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.