Home Unreal Engine

World Position Offset

Hey,

I'm using World Position Offset and Vertex Paint to paint some height into a ground plane. The problem is, I don't know how to choose which axis the mesh gets offset on. At the moment, it just kinda off goes off diagonally in every direction. Maybe it depends on which channel of the vertex paint im using?

Does anyone know how to restrict it to one axis? I tried masking it out, using constant clamps etc., but I really don't know what I'm doing. :p

Thanks

Replies

  • Adam L. Gray
    Options
    Offline / Send Message
    Maybe it depends on which channel of the vertex paint im using?

    Yep! Painting it in white will cause it to go off on all axises, thus giving a sort of diagonal offset.

    To restrict it to the different axises, simply paint using only one channel, ie Red, Green or Blue. You will find that the UDK widget represents the direction in form of colour.

    If you then want to increase the strength of the offset it gets a bit trickier. You then have to take the red channel from the vertex node and multiply it with a red constant. Respectively, you'll have to do so for each channel you use, and then add them all together using an 'add' node.

    And to get offset in the opposite direction, you need to use a new channel. Say the alpha channel if you're already using the others. And multiply the alpha with a negative red, green or whatever you fancy.

    Cheers
  • tigg
    Options
    Offline / Send Message
    Ah!, So my problem here: http://imgur.com/Af1Yh was multiplying by a constant of 10, instead of a Constant3Vector of 0,0,10.

    Thanks very much, that worked perfectly.
  • Adam L. Gray
    Options
    Offline / Send Message
    Yeah, pretty much! :D

    The separate channel outputs give you a greyscale image. So, a RGB value of 128, 128, 128 then converts to 0, 0, 128 when put together correctly (ie. being multiplied by a blue constant : 0, 0, 1).

    Just like the different channels in PS.

    No worries
  • righteousouka
    Options
    Offline / Send Message
    A trick I use is, to multiply it by world normals, which makes it expand outward along the meshes normals.


    I usually use it for doing patchs of snow, fog or a creepy flesh pulsing effect.
Sign In or Register to comment.