Im working on optimising the new terrain shader , the current status is that its now faster then the 1.41 terrain shader , and i must say the new system open up so many possibilities its a GREAT system , now we just need to find the best way to use it , i got some ideas , "cryengine style" ?
Lee:
Quote: "how I can do bitwise operations in a DirectX 9.0c Pixel Shader 3..0"
I do this when i make shadows in html ( no depth buffers supported ) i do something like this.
vec4 dpacker( highp float v ) {
highp vec4 menco = vec4(1.0, 255.0, 65025.0, 160581375.0) * v;
menco = fract(menco);
menco -= menco.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);
return menco;
}
You just need to convert it to hlsl , convert all vec to floats (vec4 = float4) and use frac instead of fract. This pack a float bitwise into .x .y .z .w ( 8bits ) just repeat each one to split again into 16 values ( sure change division to match ).
I see what your trying to do , but in the end it will just be to slow , as the only option in the end is to , evaluate and or execute ( same speed ) each and every combination , this will produce way to many samples and/or branches.
Could be done for a few of the slots.
I have another idea , with ALL these textures we have so many options , so a cryengine style could be made, that include a variation map to control it. Im writing some text about how to do this, but perhaps we should do this in another thread as it deserves its own "terrain" thread

best regards Preben Eriksen,