Quote:Original post by JavaCoolDude
As far as I know fragment programs and shaders for that matter do not take an input color or an existent fragment and act on it to produce the output.
The 'input color' and 'existent fragment' in this case are two seperate things, seperated by the disjunction 'or'. Fragment shaders do take an input colour, therefore my response was not invalid. Choose your words carefully and they wont be misinterpreted. Also, if you bothered to read my previous posts, you would have noticed I mentioned the fact that frame buffers were not even mentioned till AFTER I made my first post, at which point you have done nothing but complain about what I've written.
Since this was not clear enough, I'll try to make it as clear as possible. THIS is how I saw Lutz's posts:
Lutz: "I've got this fragment program:"
//Cg codetypedef struct { float4 col0 : COLOR0; float4 tex0 : TEXCOORD0;}FragIn;arbfp1 fragout_float main(FragIn inFrag){ fragout_float outFrag; float4 c1 = calculateC1(); float4 c2 = calculateC2(); outFrag.col = inFrag.col0; return outFrag;}
From there, I was obviously confused as to how in the hell Lutz couldn't get the desired result. This *should* be evident by my posts. The single line of code needed to turn this into something usable is this:
outFrag.col = c1 + inFrag.col0 * c2;
After all, if the fragment program already calculates C1 and C2, would it not be safe to assume (without the buffers you NEGLECTED TO MENTION earlier) that this would solve the problem?
Lutz, PLEASE REMEMBER TO NOTE DOWN EVERYTHING RELEVANT TO YOUR PROBLEM NEXT TIME. Finally, JavaCoolDude, I'm not psychic, so don't start complaining about my replies when I haven't been given all of the relevant information.