NokiMo
pucklovesgames
pucklovesgames

patreon


Environment Interaction - Updated FILES

I've made some tweaks to the Environment Interaction system, so here are the updated files!

The biggest change is now grass/foliage interaction happens in the R and G channels, to define a 2d direction, so you can now push grass out of the way, and it could also be used to bend larger plants..

Water ripples are still in the B channel.

Mud (and squashed grass) is now in the A channel.

I'm now defining 0.5 as the midpoint for any channel, and then in shader remapping it from -1 to 1 (-0.5 then *2), so mud and ripples can now push outwards and inwards from the surface. You can see this on the mud trails where the outside of the trail is raised slightly.

Let me know if you have any thoughts, improvements or changes, or any questions, or if anything doesn't work properly! That's what I'm here for.

Thanks again for your support.

PS: I've had to mess around with the various particle shaders to write appropriate channels to the render texture, they could probably use cleaning up later and consolidating into less variations.

TO DO:

Make some larger plants to push out of the way, and bake their pivots in their UV channel so they can bend nicely and still batch for performance.

Add a flow map to the water via Vertex Colours (or in their UV channel), so that the river can flow, and also push the ripples in the direction of the flow - could look really cool! Probably using this great (free) asset to paint the flow map - https://github.com/slipster216/VertexPaint

Instead of just pushing the grass down, leave a trail renderer behind, or a trail of custom particles, to make the grass lie flat in the direction of travel. Will probably look better.

Find a way to fit in "cut grass" into the shader. I'm all out of channels, but I'd like to do a "Breath of the Wild" style grass cutting system, and this setup would be perfect for it. Can we use 2 separate render textures? That's overkill surely. We could use a different texture format, to allow for negative values... or squeeze it into the A channel. Mud doesn't need that much resolution.

UPDATE: There's a potential issue where you might not see the normal offset showing up correctly if you edit and resave the shader, as it might default to the "Normal Create" function node that ships with Amplify Shader Editor. I've actually tweaked my version to use the Blue channel of the input heightmap, whereas the default "Normal Create" uses the Green chanel. You'll want to go into the function and swap over back to the Blue channel on the three Texture samples there. The best fix would be to make a "Normal Create B" version of the Shader Function and use that instead. Let me know if you need any help with that!

UPDATE:

Here's a version of the Ground shader (interactive mud) that uses tessellation and displacement instead of just a normal map to do the interaction. Download MudInteractive.shader and use the settings in this screenshot.



Environment Interaction - Updated FILES

Comments

Sorry about that. I can clean up the package a bit and help you set it up better. You should come say hello on the Discord and I can talk you through any issues you have, it might be easier to chat and work it out. The grass meshes in the scene are just custom geometry - I'm not sure if it will be able to work with Unity Terrain detail grass - although perhaps - all it really needs is a custom shader and it could work. Tags always fall off unfortunately, I'm not sure a good way to make them stick around. I'll let you know once I've made those updates.

Puck Loves Games

Doesn't seem to work with Unity terrain detail grass, though I would really like it to. I'm not even sure why it works with those grass meshes you added. It didn't work with anything I tried to add to it. Also there's scripts on the cameras that are missing, not sure what they were for. Also the tags all fell off and it picks random tags of mine to use instead which is no good. Wouldn't hurt to add a script to move the capsule to see it in action. A documentation/set up instructions PDF inside of the package would have been helpful too. Ultimately this wasn't what I was hoping it would be.

this is cool! Excited to try and figure out what it all mean. -Wisp

JSART


Related Creators