woodplank VEX shader

   6620   8   0
User Avatar
Member
176 posts
Joined: July 2005
Offline
I am having problems getting the wood plank VEX shader to stay put. When I render it out, the texture is perfect in some spots and then it swims around in others. I have tryed using a rest position, and I have also tryed plugging the s and t from a global parameters into the surface position of the woodplank VOP. Any suggestions would be appreciated.
Thanks,
Dan
Lynch_ppl@yahoo.com
User Avatar
Member
105 posts
Joined: July 2005
Offline
Did you try wiring a UV Space Change VOP output to the P input of the Woodplank VOP and setting the Space parameter (in the uv space change vop) to ‘object’?

cheers,
tk
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
How are you computing the uv's?

If you are adding uv's with a uv texture SOP or equivallent after you deform the geometry, then you will definitely get swimming textures.

The game in Houdini is to see how high up you can apply the uv's so as to avoid the above issue.

Rest SOP won't help you with uv's, only patterns that need “P” position.
There's at least one school like the old school!
User Avatar
Member
176 posts
Joined: July 2005
Offline
I have not tried a UV space change, I will definetly test that out. As far as adding a uv texture SOP, I have not done that, so that is not the problem.

My exact setup is as follows: I have a global variables VOP with the s and t outputs plugged into a float to vector VOP, with the output of that plugged into the P of the woodplank VOP, with the output of that plugged into the diffuse input of a lighting model VOP, with the output of that into the output VOP. Other than the global variables and float and vector VOPs, I did try the rest postition VOP which hasn't worked either.

I just tryed the space change, the results look the same. But I noticed that when I lay down a Grid SOP and apply the same texture, it looks different than the actual floor with the texture. My floor is procedural and relies on the house that it's inside of. Also it isnt a perfect rectangle. I think any breaks in the geometry like a polysplit will mess up the shader, this may be my problem.

I also just tested out tracing the odd shaped floor with a curve SOP and putting the shader on that and the texture is just not straight, it messes up around the non rectangular parts, so the polysplits were one problem, but the odd shape I've discovered is another.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Yep, using the default s and t's out of the Global Variables VOP will get you swimming textures if the surface stretches and contorts. The s and t ‘s fetch you the geometry’s parameterization and NOT the uv's that you probably want.

Please put down a Shading Layer VOP. This will grab uv's from any layer. Leave at default 1.
Wire this in to a Vector To Float VOP. Wire the first two outputs from the Float To Vector (u and v) in to the s and t inputs of the woodplank and you should be good to go.

This assumes that you have uv's on your geometry. The nice thing with using the Shading Layer VOP all the time is that it will default to using s and t's if there are no uv's present on the geometry. I never use s and t out of the Globals. They are there for convenience and completeness as far as I am concerned.
There's at least one school like the old school!
User Avatar
Member
112 posts
Joined: July 2005
Offline
Rest SOP won't help you with uv's, only patterns that need “P” position.

Jeff, can you explain how that works? Why wouldn't Rest Position SOP work with uv, and are you saying that only procedural textures and shaders work with Rest Position SOP?

Thanks
www.tirgari.com
User Avatar
Member
176 posts
Joined: July 2005
Offline
Hey Jeff-
By having uv' s on the geometry, do you mean like a UV texture SOP? I thought that you said that would cause swimming textures earlier.

So use the space change if there is no uv's, and if there are uv's, use the shading layer VOP?
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
If you dynamically apply your uv's with the UV Texture SOP AFTER you do any deformations to the geometry, then yes, you will get swimming textures.

What I intended to say was to apply your uv's as high up as possible on the static geometry.

One good test to see if you have animated uv's is to press space-5 in the 3D viewport to see the uv's then press play. If you see animated uv's here, you will have problems.

I also know that there is some confusion between P and uv's. It doesn't help that this particular woodplank material takes both P and s and t's.

Certain shader functions work better with uv's or with P. UV's are associated with texture maps and “P” is most associated with procedural volume patterns like the many different noise, brick, floor and wave patterns.

Here is what I do to avoid swimming texture issues and take complete control over the situation regardless of P or uv. Each has their own set of concerns and tools to work with them:

“P” position = rest SOP on geometry and Rest Position VOP
With patterns that require “P”, you need to concern yourself with space changes or this all goes away if you simply apply a rest attribute to your geometry and you pick up this rest attribute with the Rest Position VOP in your displacement and surface shaders. This is a Houdini technique employed for years now. There is no direct equivallent in prman or Maya that the user directly manipulates so it is a bit of a Houdini black art technique but very simple and incredibly effective.

The rest attributet is simply an alternate set of xyz positional data carried around by your geometry. It should be a static representation of your data at rest. The name rest is arbitrary but throuh years of use, has become a standard. The Rest SOP is best used with two inputs being the same on the static geometry early up in the SOP chain before any deformations.
The beauty with Rest SOPs is that this is carried aorund all the time by the geometry, no matter how it is deformed, ripped apart, instanced, object merged, anything. There is the ever persistent problem of novice users utilizing object merge SOPs in alternate objects with different parenting heirarchy and the usual support call “my textures are swimming or are changing”. Even utilizing space changes in your shader will not eliminate a change in the procedural pattern. All your hard work on tweaking your noise is lost with a simple scale in the heirarchy. With rest attributes, this all goes away magically!

Texture Coordinates = Shading Layer VOP.
With texture coordinates, you only need to worry about the uv's as applied to the geometry and pretty much nothing else. Sure you can apply space changes to the uv's for special situatioins but for the most part, you don't need to worry about how the uv's come in to the shader. Just use the shading layer VOP to pick up the uv's in your shader to make things easy.

I will try to add a complete discussion on P and uv's to the OdForce wiki with examples in the coming days as my time permits.
There's at least one school like the old school!
User Avatar
Member
176 posts
Joined: July 2005
Offline
I actually got it to stay put by tracing the geometry with a curve, and using a UV space change hooked into the P, and a shading layer VOP on the s and t.

It would be much better to maintain the procedural nature of the geometry by using the rest attribute, that I am going to play with next.

Definetly going to look out for the Odforce stuff whenever you get that out.

I appreciate the help!
Dan
  • Quick Links