knackered
01-16-2002, 02:35 AM
I'm using a geforce3. Bear in mind I'm pretty new to nvparse (and its odd syntax).
I have an animated 'normal' texture (tex1), and a static 'normal' texture (tex2).
In the register combiners, I want to add a normal from tex1 to tex2, and normalise the result - then dot product this vector with the light vector (col0).
I'm getting 'white-out' when I try this:-
nvparse(
"!!RC1.0 \n"
// add normal from animated texture (tex1) onto normal from static texture (tex2)
"{ \n"
" rgb { \n"
" discard = expand(tex1); \n"
" discard = expand(tex2); \n"
" spare0 = sum(); \n"
" } \n"
"} \n"
// normalise this vector
"{ \n"
" rgb { \n"
" spare1 = spare0 . spare0; \n"
" } \n"
"} \n"
"{ \n"
" rgb { \n"
" discard = spare0; \n"
" discard = half_bias(spare0) * unsigned_invert(spare1); \n"
" spare0 = sum(); \n"
" } \n"
"} \n"
// dot product the normalised vector with the light vector
"{ \n"
" rgb { \n"
" spare1 = spare0 . expand(col0); \n"
" } \n"
"} \n"
// output the dot product result directly, for testing purposes
"out.rgb = spare1; \n"
"out.a = unsigned_invert(zero); \n" );
I have an animated 'normal' texture (tex1), and a static 'normal' texture (tex2).
In the register combiners, I want to add a normal from tex1 to tex2, and normalise the result - then dot product this vector with the light vector (col0).
I'm getting 'white-out' when I try this:-
nvparse(
"!!RC1.0 \n"
// add normal from animated texture (tex1) onto normal from static texture (tex2)
"{ \n"
" rgb { \n"
" discard = expand(tex1); \n"
" discard = expand(tex2); \n"
" spare0 = sum(); \n"
" } \n"
"} \n"
// normalise this vector
"{ \n"
" rgb { \n"
" spare1 = spare0 . spare0; \n"
" } \n"
"} \n"
"{ \n"
" rgb { \n"
" discard = spare0; \n"
" discard = half_bias(spare0) * unsigned_invert(spare1); \n"
" spare0 = sum(); \n"
" } \n"
"} \n"
// dot product the normalised vector with the light vector
"{ \n"
" rgb { \n"
" spare1 = spare0 . expand(col0); \n"
" } \n"
"} \n"
// output the dot product result directly, for testing purposes
"out.rgb = spare1; \n"
"out.a = unsigned_invert(zero); \n" );