RGBA signature NOT working in VEX

   6690   5   0
User Avatar
Member
436 posts
Joined: July 2005
Offline
I don't get it.
With both Color Map and Texture tiles in VEX, if signature is set to RGBA (the source file is RGBA SGI format) the tiles are not working. The downstream tiles all fail.
I do not understand why I cannot connect output of RGBA image into Of slot of output. The alpha channell should automatically be used to matte the shader.

I have simple objective.
Feed the RGB of RGBA image to Color of shader and alpha to Opacity. But the workflow is so confusing and its not working.

DaveR
User Avatar
Member
436 posts
Joined: July 2005
Offline
Secondary issue is that the VEX shader is ignoring the UV coordinates of the object and is being applied on face basis. WHile a SHOP material applies normally.
The SHOP SuperMaterial is using same texture map and is being applied to same object. It renders fine, but without transparency even though the alpha of image file is being specified to use in TRANSMAP.

The VEX version of the material, is using two files from the original image file. The RGB is used in Texture->Lighting Model->Cf of Output
The grascale alpha channell (a separate file) is being used in Texture->Of of Output.
The result of VEX shader is correct but its mapping is wrong.
Instead of honoring object UV coordinates, like the SuperMaterial, it is being applied on per face basis. That is the texture file is placed on every face.
What tile is missing from VEX shader so it honors existing UV coordinates of the object?

David Rindner
User Avatar
Member
4262 posts
Joined: July 2005
Offline
DavidRindner
I don't get it.
With both Color Map and Texture tiles in VEX, if signature is set to RGBA (the source file is RGBA SGI format) the tiles are not working. The downstream tiles all fail.
I do not understand why I cannot connect output of RGBA image into Of slot of output. The alpha channell should automatically be used to matte the shader.

I have simple objective.
Feed the RGB of RGBA image to Color of shader and alpha to Opacity. But the workflow is so confusing and its not working.

DaveR

Short Answer:
If you set the signature to RGBA the texture returns a vector4 type. (RGBA). However Of needs to have a vector as a input. So you need to convert the alpha channel to a vector.

Long Answer as an example:
Connect the output of the “Texture VOP” (RGBA) to a “Vector4 to Vector” VOP. This will split the RGBA into a vector and a float. From here you can just connect the vector output to Cf, since this is your RGB data. For the opacity you need one more additional VOP. Since opacity needs a vector as input you need to convert your alpha channel (which is a float) to a vector. So create a “Float to Vector” VOP and for each of the three inputs use the float value from the Vector4 to Vector“ VOP. Then feed the output of the ”Float to Vector" VOP into Of and all should be good.

Sample file:

http://stickylight.com/FLinks/texSample.hipnc [stickylight.com]

jim.
if(coffees<2,round(float),float)
User Avatar
Member
4262 posts
Joined: July 2005
Offline
DavidRindner
Secondary issue is that the VEX shader is ignoring the UV coordinates of the object and is being applied on face basis. WHile a SHOP material applies normally.
The SHOP SuperMaterial is using same texture map and is being applied to same object. It renders fine, but without transparency even though the alpha of image file is being specified to use in TRANSMAP.

The VEX version of the material, is using two files from the original image file. The RGB is used in Texture->Lighting Model->Cf of Output
The grascale alpha channell (a separate file) is being used in Texture->Of of Output.
The result of VEX shader is correct but its mapping is wrong.
Instead of honoring object UV coordinates, like the SuperMaterial, it is being applied on per face basis. That is the texture file is placed on every face.
What tile is missing from VEX shader so it honors existing UV coordinates of the object?

David Rindner

Your VOP network doesn't automatically know about your texture coordinates so you import them yourself. The s and t in the Global Parameters VOP are the parametric coordinates. Those might work on NURBs but on polys you run into the problem you are having.

If your model has uv coordinates that you applied in SOPs you need to create a new Parameter VOP to “import” those coordinates in. For the Parameter type set it to 3 Floats (vector), for the Parameter name set it to “uv”. Since the output of this VOP is a vector you need to split it up into floats. Append a “Vector to Float” VOP and now “fval1” is your U coord, and “fval2” is your V coord.

http://stickylight.com/FLinks/uvSample.hipnc [stickylight.com]

jim.
if(coffees<2,round(float),float)
User Avatar
Member
711 posts
Joined: July 2005
Offline
You can also use the ShadingLayer VOP to import your model's UV coords. I had the same prob as David, and after a little trial and error I found that this VOP did the trick. Is there any big difference between one method or the other?
User Avatar
Member
436 posts
Joined: July 2005
Offline
Thanx

Shading Layer tile works great.

Except a new problem has crept in.
The RGB of rendered image does not honor the transparency of the shader but alpha of the image does. Unfoutunatly, simple Alpha compositing is not enough to get rid of errand pixels. I am wondering why the RGB of the rendered image is not honoring transparency of the shader?

Dave
  • Quick Links