|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| Offseting RGB of a texture, based on Y position
|
|
|
Hi,
Render Tree “programing” is my weakest side…
I wonder if it’s possible at all, to create a shading network, that will offset the RGB values of the texture, based on let’s say, the Y position in Global space..
I am trying to created an effect, that the closer the geometry is to the camera, RGB values on the texture start sliding away, creating this out-of-phase blury thing :)
cheers,
Oz Adi
|
|
|
|
[quote=Oz Adi;19605]Hi,
Render Tree “programing” is my weakest side…
I wonder if it’s possible at all, to create a shading network, that will offset the RGB values of the texture, based on let’s say, the Y position in Global space..
I am trying to created an effect, that the closer the geometry is to the camera, RGB values on the texture start sliding away, creating this out-of-phase blury thing :)
cheers,
Oz Adi
If you want to apply this effect on a pixel-by-pixel basis, then mental ray is the way to go. But if you want to apply the effect to the object as a whole based on it’s transform, then FXtree is probably the better option. The XSI shaders out of the box don’t give you options to look up object transforms and use them in a shading network. To do that would require writing your own shader code. Not difficult, but you have to do it yourself.
For the pixel-based effect, use a vector_state shader and lookup the intersection point of the surface. This will return the coordinate of the pixel being rendered in world space. To be safe, pump the output into a vector_coordinate_converter and convert to world space, treating the vector as a point as technically mental ray performs the calculation in ‘internal space’, which is usually world space in this context, but not guaranteed. see mental ray docs if you want the full explanation. Anyway, after you have your vector, pull the Y coordinate as you desire and use that as input of a change_range. Set your change_range to a desired output range (usually 0...1) and use that to drive your color shifts. the change_range input range would be the min/max Y values you’d be willing to accept as valid input.
vector_state -> vector_coordinate_converter -> vector_to_scalars (pick Y) -> change_range -> whatever you want.
For object based effect, apply an expression to the object in question, and tie it to a parameter on an FXtree node that does your color correction. Then render.
Matt
|
|
|
|
[QUOTE=mantom;19611]The XSI shaders out of the box don’t give you options to look up object transforms and use them in a shading network. To do that would require writing your own shader code. Not difficult, but you have to do it yourself.
You could use ICE as Workaround. In ICE you can read out Object Transforms, write them into Scalar Attribute, and pipe them with an Attribute Shader into the Render Tree. It works with Particles, don’t know if it’s working with Objects, but you can give it a Try.
|
|
|
|
Thanks guys!
I got it to work, using the shading network you suggested, Matt..
I got two textures, one normal, second one phased, and I mix between two,
using the Y position in world space…
thanks, again..
Oz.
|
|
|
|
|
|