texture shaders

DemoCoder

Veteran
For those that know :), I have a question as to how they are implemented. It seems the only way they could be implemented by D3DX is using the CPU to rasterize the shaders. Couldn't find implementation details. Is this correct, or can it somehow use the GPU?
 
can we get a little backround too . For those of us who spend to much time chasing ladies ?
 
Well procedual texture can be done Currently by either creating a static textures in memmory using a shaders and a simple render to texture OR you can embed the preocedual texture code into a shader ( or you could multipass it of course and have it as a sperate dynamicly created texture). Nothing really new their.

So I'm guessing DemoCoder is talking about some kind of special texture type where you can use a normal texture look up on it but it will on the fly run the shaders to create the texel? I haven't heard of any such thing existing in DX9 but I don't really know that much about DX9 either. Until we get virtualised texture look-ups and instruction counts I don't see how its can be easily intergrated into any api.
 
DemoCoder is (I assume) talking about D3DX9 Texture Shader objects (which only recently have become objects, in the current release its just a special D3DX effect type).

This is a special type of HLSL/effect type that allows standard HLSL code to be run into a texture. AFAIK Currently its purely a CPU thing I think but there is no reason that in future they could possible implement it as a GPU accelerated thing.

Why is this handy?
Imagine 2 different cards that process texture read vs ALU operations very differently. Say card A get a texture read for free, whereas card B does the actual ALU operations faster than a texture read (or more accurate etc). You can then write a HLSL function that does the operation and at runtime detect which card is which and either use a texture shader to build a texture with a lookup table or just call the function in the actual shader.

At the moment its totally manual and largely undocumented but the latest BETA is changing things a fair bit in this area.
 
Thanks Deano. Yeah, I just didn't want to violate the Beta agreement. DX9.0c added a third type of "shader", but it looked to me like it was purely a CPU rasterized convenience for static load-time procedural textures (rather than dynamic procedural textures)
 
Just to add my 2 cents: Another aspect is that procedures are normally much lighter than data, which is important in bandwith restricted situations. Any level downloaded would benefit from it - that would well improve the user experience for them...
 
Back
Top