havenphillip Posted March 20, 2021 Share Posted March 20, 2021 I made this forcefield shader using the watermode depth buffer which works great. I replaced the Leadwerks water shader with this dummy shader: //fragment #version 400 //Uniforms uniform sampler2D texture4;// depth void main(void) { float depth = textureProj(texture4,vec3(1)).r; } //vertex #version 400 #define MAX_INSTANCES 256 void main() { } ... and I used this script to turn on watermode and set the waterplane height: function Script:Start() world = World:GetCurrent() world:SetWaterMode(true) world:SetWaterQuality(1) end function Script:UpdatePhysics() world:SetWaterHeight(3.0) end ... everything works great and the shader works with post effects, which is something I couldn't get accomplished before, AND I'm getting excellent FPS. The problem is I lose the effect as soon as the water plane goes off camera. So I'm thinking if there is a way to create a "depth mode" which keeps the (invisible) water plane on camera at all times that would open up a nice little corner for using the depth buffer for things like a forcefield, water foam, water fog, ground fog, and soft particle falloff effects such as seen here: http://blog.wolfire.com/2010/04/Soft-Particles 2 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted March 27, 2021 Share Posted March 27, 2021 Soft-Particles would be a must for clouds simulation colliding with mountains uns so much more. (sorry no idea how to help) Quote Link to comment Share on other sites More sharing options...
havenphillip Posted March 30, 2021 Author Share Posted March 30, 2021 That's ok, man. I got the soft particle thing and the forcefield working using this method. The problem I was having was because I had other shaders in my scene using texture4 for something other than depth. They work perfectly now. I don't know why Josh wouldn't just set up a "depth mode" as a permanent thing so that people could use depth buffers for cool stuff. Leadwerks' aversion to shaders is self-defeating, imo. 1 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted March 30, 2021 Share Posted March 30, 2021 Quote I don't know why Josh wouldn't just Because he is completely concentrated on coming forward with Ultra engine. We all (are/have) missing a few thing in the actually LE that could made the editor just top, but well. Do you think about publishing your soft-Particles shader or make a tuto on this ? 1 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted March 30, 2021 Author Share Posted March 30, 2021 Yeah I'm just stockpiling right now. I have a bunch of shaders I'll put out in a while. I don't think it will matter that much since I think everyone's moved on from LE4. I get the benefit of having put in the effort, though. Quote Link to comment Share on other sites More sharing options...
Marcousik Posted March 30, 2021 Share Posted March 30, 2021 There are still people (I am one of them ^^) who still work with LE4.6 and try to build something / finish what they began I spent hours learning how to use it and I made progress in building a game, so that I want to finish it. And there is the very positive argument that the actual version 4.6 works stable and it will need a looooong time until the new baby Ultra keeps a way without updates required. So I enjoy working with 4.6 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.