Precomputed Procedural Texture ?

Started by
1 comment, last by C0lumbo 10 years, 4 months ago

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.

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. :)

Sean Middleditch – Game Systems Engineer – Join my team!

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.

This topic is closed to new replies.

Advertisement