Hey, so I’ve been having some success understanding and writing fixed-function shaders and am considering doing something in Cg (which I have yet to learn, although I have the GLSL orange book so I get the basic principles).
I’d like to write a simple fake/fixed bumpmapping/texture-coordinate-displacement effect.
I guess it’d be kinda like normal mapping
but with precalculated lookup coordinate offsets stored in the texture. The texture should hold 16-bit X,Y offsets ie Red-Green is X, Blue-Alpha is Y - maybe using a fixed-point number format for a typical screen resolution, maybe 12-bit integer, 4-bit decimal to support offsets up to 4096?
I’d like to read values from this texture according to standard texture mapping (using the uv channel from the mesh), get the X,Y data from the texture, and then add the X,Y coordinates to the texture coordinate. This resulting tex coord would then give the lookup into a second texture - an actual RGBA image texture - and the texel pulled from that coordinate would then be rendered on-screen.
So the final effect would be a simple displacement of texture coordinates on a per-pixel basis.
My question is, besides writing this shader, is - is it possible in Unity free version
to read from textures inside a Cg program? I don’t need to write to them, just reading. Is that supported or can you only read textures on UnityPro?