havenphillip Posted December 2, 2019 Share Posted December 2, 2019 Would it be difficult to do this for regular Leadwerks as well? It just looks really cool. It Quote Link to comment Share on other sites More sharing options...
Josh Posted December 3, 2019 Share Posted December 3, 2019 It would be possible to write a tessellation shader based on the content of the LE5 shaders. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
havenphillip Posted December 3, 2019 Author Share Posted December 3, 2019 I wish I knew shaders well enough to make something like that. I messed with the tesselation shader and found some geometry shaders but I can't see how to take care of those cracks in the seams. If you integrated this into Leadwerks 4 and sold it as an add-on I'd buy it. 20 bucks. These texture editors make your heightmaps look cool but then you bring it to Leadwerks and you lose a little bit in translation. Then again, it might serve better strictly as a selling point for LE5. Sounds like you got some ground-breaking stuff going on over there. Either way Turbo look great. Two thumbs up. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted December 4, 2019 Share Posted December 4, 2019 The way I get rid of cracks is by disabling displacement along seams. The new engine uses a per-vertex displacement value but you could use the vertex alpha to control the displacement amount. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
havenphillip Posted December 4, 2019 Author Share Posted December 4, 2019 Dude, how do I get the seams? and then use vertex alpha to control the displacement? What is it? Like length(texcoords) or something? Do you have a code example or even a shader you'd be wiliing to impart? Or a webpage or tutorial somewhere that shows an example? That would be awesome. I learned how to displace but after reading your article I just assumed you needed "per-vertex" which I thought meant you have to subdivide. I've been scouring the internet for geometry shader examples for subdivision and tesselation shaders. I imagine the new engine will be much faster, and therefore better for this kind of thing, but I'm still trying to wrap my head around LE4. Quote Link to comment Share on other sites More sharing options...
havenphillip Posted December 10, 2019 Author Share Posted December 10, 2019 Hey Josh I know you're busy and I keep bugging you with this but could you explain real quick how I get the seams so I can disable displacement on them. I've been looking everywhere and can't seem to find the answer. This is my displacement code: //Vertex displacement //----------------------------------------------------------------- vec4 height = texture(texture3,ex_texcoords0); float offset = (height.r + height.g + height.b)*0.025; vec4 newPos = vec4(modelvertexposition.xyz + vNormal* offset,1.0); if (height.r > 0.5) { gl_Position = projectioncameramatrix * newPos; } //------------------------------------------------------------------- Quote Link to comment Share on other sites More sharing options...
Josh Posted February 16, 2020 Share Posted February 16, 2020 There is a Mesh::UpdateEdges() method (Leadwerks 5) that will attempt to find them and set vertex displacement based on that. I don't think you can do this in the vertex shader. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. 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.