PDA

View Full Version : Newbie to Vertex pipeline: How to use World-position Offset?



KazeoHin
11-08-2009, 12:54 AM
Hey there, I'm pretty familiar with the Unreal Engine version used in UT3, however the UDK version has some neat new features, one of which is the "WorldPositionOffset" material channel. I was able to get this working by plugging a constant or float3 into the channel, and using any math functions; However I'm sure there is much more to this than simply moving the entire mesh one way or another. Does anyone here know how to properly use the 'WorldPositionOffset'?

Spoondog
11-27-2009, 04:40 AM
You pretty much got it right, but you need to scale it down. Then you can combine a world position node with some time/sine nodes and get a wavy effect, then hook it up with some wind actors I believe so you could have cloths blowing in the wind (cheaper than using physics), grass waving... But I'm still in the testing stage myself and haven't completely figured it out yet either :) (You probably figured it out by now anyway) Note it will not work if certain nodes are hooked up to it e.g. texturesample. There is a brief UDN page on it but it's not open to the public.

Denny
11-27-2009, 05:17 AM
Here's an example map with waving grass. It's not good looking but it's a start. :)

killfassil
11-30-2009, 06:58 PM
I don't really get it. If it is an offset, why do we need to have a world position node ?
Plus it's really sad that we have to use vertex color and not masks.

gokzor
12-01-2009, 12:22 PM
Id imagine you have to use vertex colour as it will effect the model vert by vert so a mask would be pointless really. But im not too sure as i havnt looked at this at all.

urgrund
12-01-2009, 11:06 PM
I don't really get it. If it is an offset, why do we need to have a world position node ?
Having access to world position is important for a number of things... you can almost treat it like a "random number" if you have many instances of the same mesh scattered... such as plants, you could use WorldPos to index a color table to tint the instances. You could use WorldPos to orthoproject a scrolling outdoor cloud layer or even to auto-UV terrain.


Plus it's really sad that we have to use vertex color and not masks. It operates per-vertex... per-pixel (masks) in this case is overkill and positions are defined first by vertex then interpolated per-pixel across the surface. Not to mention having to author and manage more 2D assets just to paint the mask as well as sacrificing another UV channel (maybe hijacking the Lightmap UVs?) to map the mask to the mesh - as well as compression and resolution limitations of a mask (texture).

Having it per-vertex means nice, smooth interpolation between vertices, is the most practical (content authoring) and the fastest (shading cost).

scruffy
12-02-2009, 03:18 AM
i just wrote up a tutorial showing different ways to use this. here`s the link.

http://www.youtube.com/watch?v=cfTzUwDeUbM

enjoy.

gokzor
12-02-2009, 06:00 AM
awesome thanks!

Piranhi
12-02-2009, 08:21 AM
Thanks for that video, it really explains a lot.

KazeoHin
12-02-2009, 08:45 AM
AWESOME. Thanks for this: my head is spinning with the new possibilities this presents....

killfassil
12-02-2009, 11:20 AM
You could use a mask, not to apply it directly on the mesh, but to project it worldwise (using world coordinates) and create waves of wind for example.
If you want to achieve this with procedural work only, you'll have a hard time creating nice shapes for your waves, whenn panning masks multiplied would easily give very nice results.

Piranhi
12-02-2009, 11:50 AM
This may not be perfect, but Christ, it makes a pool of water look so much better.

Dralex789
08-23-2010, 06:30 PM
You could use a mask, not to apply it directly on the mesh, but to project it worldwise (using world coordinates) and create waves of wind for example.
If you want to achieve this with procedural work only, you'll have a hard time creating nice shapes for your waves, whenn panning masks multiplied would easily give very nice results.

What do you mean project it worldwise? I am slightly confused by this. Sorry the threads been dead for a while but Ive been looking for ways to force vertex colors to look at images.