exerion wrote:We can't use image effects as this is for a mobile game, it would be to slow.
We've managed to get something working but because we can only set the vertex positions in local space it does weird things if the object rotates.
In the General settings you can set the Vertex Output to Absolute or Relative but these are both in local space. I need a World option or the ability to supply a World Offset. I need to be able to offset the vertices height in world space.
exerion wrote:Hi Ricardo =D
We got it all working thanks to your help. For those who want to do something similar this is how we did it. Note it technically doesn't curve the world around it just lowers the verts at an increasing amount the greater the distance from the CurveSphereTip vector3.
We have made a Amplify Shader Function. I would attach the shader function asset file but it's not permitted. You could make the CurveSphereTip vector3(defines the curve origin) and the CurveMultiplier float(defines how much curve) parameters global so you can control the curve globally rather than having to set it on each material. You can see how this is done in the great link Ricardo posted - http://grrava.blogspot.com.au/2015/05/bending-world-with-unity.html
Add the shader function to your shader (you may have to restart ASE before you can add it). Set Vertex Output to Absolute.
If you didn't make the CurveSphereTip and CurveMultiplier global you can adjust the settings on a material that is using your shader. This is what you can expect to see.
Ricardo, we're not sure how to globally disable and enable the effect. We tried to enable/disable the Keyword using Shader.EnableKeyword/DisableKeyword but the checkbox in the material inspector seems to override whatever we do.
When we're ready to reveal our game we'll post some screenshots =D
exerion wrote:Hey thanks for the reply =D
So if we wanted to create a shader feature that can be enabled/disabled globally, how would we go about it? ie when the player disables 'curve world' in the options menu in our game. It does not seem feasible to iterate over every material in the game and disable the keyword one by one? Isn't this what Shader.Enable/Disable keyword is for?
Users browsing this forum: No registered users and 1 guest