Considering that the RVT is scaled to the landscape, and it’s possible to draw a mask wherever you want based on that, I was hoping someone could tell me how to obtain coordinates at the center of the mask on the landscape. I assume there’s a mathematical way of obtaining this based on UV space.
I thought that TransformPosition would work but I was unable to make it function. I need to do this because I am limited with positions in Material Collection Parameters since we’re unable to dynamically add parameters at runtime.
The object in question is ofc the landscape.
This works as a function on anything - tiled landscapes - so long as they are in fact square. Which is the default epicCentric behavior.
To cycle through tiles, you have to drive the input values dynamically - from the character you feed the current tile’s position and the object bounds (size of the tile).
End result is something like this here:
Except instead of drawing into the landscape I’m drawing a vector field and displacing individual grass strands.
The RTV still works on the landscape too though.
I really appreciate the reply. Indeed UV space is simply 0-1 which is why I know there’s a way of getting x, y, and hopefully z values to get world position using an RVT mask to determine the relative coordinates based on essentially any white pixel:
I couldn’t quite determine if the code you showed does that, but it doesn’t appear to do what I need and I couldn’t figure out how to use the RVT mask with it. Basically, instead of setting the influencer position inside the material collection parameter through blueprints, I want it to be based solely on the RVT mask that way I can have multiple influences as well as enabling me to do some more advanced wind stuff.
Here’s what I have so far, wind influence strengthened for effect:
I ultimately just need a way of feeding all influencer positions to all players at all times thru materials, and by my estimation the best way of doing this is with the RVT mask. I fear I may have to learn custom shader code to do this by detecting white pixels in UV space and doing the corresponding math to get positions. Am I way overthinking this perhaps? Does your method allow for multiple influences?
Look,
For foliage, instead of feeding anything to anything. Or re caculating anything, just
Use the texture.
That is essentialy how im getting the grass to displace under the helo blades.
Drawing to the RTV is done by each client or player for a specific distance around the player.
The RTV and resolution im using varies, but its placed under the object, and moves along with the object.
Its not replicated, and most importantly really only exists locally.
Enemy players arent the main player, so they simply dont have the bits that travel along - they do however generate things that are caputured in the RTV.
In my case, because i’m using a distance field, im capturing the rtv with a camera.
In the case of the helo, i’m also drawing to a render texture - either system works if done right.
The general rule of thumb is that placing the UV under the character involves dividing the WPO x/y by the size of the texture.
Let me screenshot that.
Meanwhile.
Calculating a pixel position from a texture is a horribly bad idea for performance. Reading the file is generally expensive. The material has instant access to it by using it.
The data isn’t being read with the intention of it being altered though, which is why its generally fast.
Theres a lot to this - though in reality i probably should have released a redux marketplace product for it…
Having actual locations allows me to do some great stuff with foliage/wind, specifically pushing foliage away in unique ways. For example enabling me to push away an entire entities mass rather than merely under it. (Massive creatures pushing away trees, branches, leaves all along it’s body and all along the height of the tree). Example:
Ultimately this is definitely feature creep though and I suppose I will just stick with RVT for players as I have it now. Doing so makes infinite players affecting wind easy (albeit only under them), as well as multiplayer support a breeze. I will use actual locations for the special objects/creatures for when I need to push away foliage in more detailed ways. It’ll be easy if I add enough vectors in the collection parameter and set them that way, it’s just manual work I was trying to avoid. Realistically I will never have more than four of these massive creatures in the scene at any one time, thus I can get away with less than ~12 location vectors which is enough to cover their body, and I can always add more if I need more detail.
I was just looking to see if there was a simpler/less work method by somehow getting the RVT pixel world location and then using offsets to build the giant creatures body.
What made me even think about this is the fact that Pivot Painter textures are able to produce actual world position locations with only the TransformPosition node. But clearly there’s stuff happening under the hood that I’m unaware of.
If you notice, my grass isnt just moving, its deforming according to a custom shape.
Theres a lot that goes into making a shader that can do this. But it is possible.
And all it takes is the texture and a script to generate an appropriate mesh.
The theory is that using a vectorfiled of the shape of the creature taken from above, you can offset/push whatever is in the way however you see fit.