Hi all,
I am trying to learn from the exaples and documantation, but I seem to be stuck at one point where I don not understand what is going on.
I am trying to simplify the examples for myself massively so that I understand what is going on and so am trying to remove the texturing on the cylinder and shade it as a completely flat colour.
Problem 1:
If I take phongShaderCylinderSphereTextured.pbmk and change its evaluateFragment to this
void evaluateFragment()
{
float4 color1 = sample(inputImage, float2(interpolatedCoord.x, interpolatedCoord.y));
color1.r = 0.5;
color1.g = 0.0;
color1.b = 0.0;
color1.a = 1.0;
result = color1;
}
Then I get, as I would expect, a completely flat red cylinder. However changing color1.a has absolutely no effect whatsoever - if I set it to 0 then the flat red cylinder still shows. What is going on?
Problem 2:
If I write instead
void evaluateFragment()
{
float4 color1 = float4(0,0,0,0);
color1.r = 0.5;
color1.g = 0.0;
color1.b = 0.0;
color1.a = 1.0;
result = color1;
}
then I see nothing at all. Again I have absolutely no idea what is going on.
so
1) What is wrong with my extremely simple code?
2) What is the correct way to specify a float4 literal?
3) What are the ranges for the r, g, b and a values of a float4 (it seems that r, g and b have to add up to one - is that correct?)
Thanks for any help
Conrad Winchester
This problem has been fixed in preview 3 of Pixel Bender 3D
Bob