Can someone tell me how to express the fog equation in nvparse?
I came up with this (please don’t laugh, I’m still struggling with rc’s in nvparse, mainly because I can’t find any docs on it!):-
final_product = tex3 * col0;
out.rgb = fog.rgb * unsigned_invert(fog.a) + final_product.rgb * fog.a;
out.a = unsigned_invert(zero);
This doesn’t work - it comes up with an error.
Please help.
The reason I’m doing this is because I’m doing reflecting bumpmapping in vertex programs/texture shaders, but I can’t get the final output to be tex3*col0 with fog.
I get an error on line 1.
I really can’t find any documents on nvparse with register combiners on the nvidia website or in the sdk. There’s a “nvparse and texture shaders” presentation, but that’s it.
In the OpenGL SDK, the presentation ProgrammableTextureBlending.ppt has some infomation on using nvparse.
I haven’t used nvparse but from you post, using just the final combiner might be the error. Try inserting a stage before the final combiner stage ( that just discards results ).
No, I’ve seen a few examples where just the final combiner is used, and it works fine. If I did this:-
!!RC1.0
out.rgb = tex0.rgb * col0.rgb;
out.a = unsigned_invert(zero);
… I get the expected result…it’s just when it comes to fog (which I believe is only available in the final combiner) I can’t get it to work.
You’re welcome. I just checked the rc1.0_grammar.y file and as you noted, using just the final combiner is allowed ( the parser inserts the blank stage automatically ).