Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Precomputed Procedural Texture ?

This topic is 1672 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 guys,

 

Can I take the position (xyz) being shaded and use it to look up a colour in a 2D texture or cube map ? Instead of calculating a colour using a procedural texture function I'd like to use precreated textures.

 

I know I can implement Perlin noise in a pixel shader but that's not what I'm after.

 

I've read about cube maps but haven't seen anything about direct texturing, only about sky boxes and reflections. I don't know if using a 2D texture for this is even possible, let alone how to do it.

 

Some help would be great. Thanks.

 

Share this post


Link to post
Share on other sites
Advertisement

This is quite possible and very frequently seen in graphics.  This is commonly referred to as a "look up texture" (LUT) when used as an intermediary in calculations.

 

You can use all kinds of parameters besides position as your texture coordinates, too, such as other intermediary values.  There are no rules about what the coordinates used in a texture access are supposed to represent.  They could be normalized angles or intensity values or noise input or whatever you need.

 

Whether you need a 2D texture, a 3D texture, or a cube map is not something anyone could say without you telling us what you're actually trying to do. :)

Share this post


Link to post
Share on other sites

Sounds to me that you're after a 3D texture. A cube map consists of the 6 faces of a cube, it's hollow - there's nothing inside it. A 3D texture is the name for what you're after, a solid cube (or cuboid) of texture.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!