Jump to content
  • Advertisement
Sign in to follow this  
Lopez

user defined cubemap access

This topic is 4307 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I'm trying to implement a shadowed point light in my lighting engine. I had this idea, as gl doesn't support depth cubemaps, to encode my own by rendering the 6 views to a single depth texture (res*2 x res*3), using 6 cameras at 90 degree angles to each other - done that no problem. Now I want to access this texture in the fragment shader. I'm sending the first projection's texture matrix to the shader, so currently, I can render 1 cube face. 1. Can I derive the other 5 projection vectors in the shader, rather than passing them as uniforms? 2. Can I access a certain part of a single texture in the fragment shader if the texture is to be projected? (ie. one of the 6 depth segments I rendered).

Share this post


Link to post
Share on other sites
Advertisement
Can't you just save those 6 files as one single cubemap (i.e. using NVidia's Photoshop DDS Plugin) and access that file in the shader using a samplerCube?

Share this post


Link to post
Share on other sites
It's depth maps that I need access to, and also realtime, so no. (not currently supported).

Mainly, i'm looking at a way to derive the oter 5 projection vectors, form the one I pass into the shader.



Share this post


Link to post
Share on other sites
I don't understand. Why do you need depth cubemaps, if you're using a fragment shader anyway ? The depth format was a hack introduced to support shadow mapping in the fixed function pipeline. With fragment shaders, you can use whatever formats you want to represent or encode depth (floating point, packed pixel representation, etc).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!