![]() You can sort of see it in the soft shadows in the sheet above. That's what gives the sheet any normals at all. I put the heightmap normals information in the fragment shader from 37_normal from heightmap in both of these shaders. If and when I figure it out I'll let you know. ![]() But potentially this could be used for clothes or any other thing you want to blow in the wind. You can set it to two-sided in the material editor but one of the sides won't react to the flashlight. So with this shader you get two sheets instead of one consistent sheet. The problem is that with a two-sided object the height direction goes the opposite direction. #Tessellation shader how toThe sheet in the wind shader is a bit oddball because I haven't yet figured out how to make it two-sided. You can add a time element to your heightmap in the evaluation stage to create a wind effect using textures: So think of your control stage as "controlling" the subdivisions, and the evaluation stage has the heightmap and the height strength and all the other things you would have put in the vertex stage in a vertex displacement shader. Here's the noobalyzed Leadwerks tessellation shader. You can disable Cast Shadows in the material editor and that will go away but obviously only do that if you don't want to cast shadows at all. But don't go too far in because otherwise your plane will go beneath the surface of the mesh boundary and it will cast shadows on itself. But just swap that line in instead of the standard modelvertexposition line and adjust the number. I think Josh tried to explain it to me once but I'm not a technical guy. I still don't know how to close those seams. ![]() That's just a little trick I picked up along the way. ![]() Subtracting the vertex_normal from the vertex_position and multiplying it by some small number allows you to reduce this gap. Vec4 modelvertexposition = entitymatrix_ * vec4(vertex_position - vertex_normal * 0.1,1.0) I added this uncommented line in the vertex stage: So if you need more than 64 will allow, you will have to subdivide your model a little bit more before you port it in to Leadwerks. They get too spread out and the tessellation can't keep up with the smaller details. I'm fairly certain 64 is the maximum number of subdivisions you can do, and just like the vertex displacement the size of the object matters because the more space you have between vertices, the less crammed the details are. You can see that two triangles yields a lot. You can see how much detail you can with only two triangles: You can see here this Leadwerks box in the material editor. You can set it to exactly the number you need. This "control" over the number of vertices makes the tessellation shader superior because you can take very simple models and subdivide them to exactly the number of vertices you need without going back and forth between Leadwerks and some modeling program. The control stage in the shader does the subdivision, and the evaluation stage can be thought of as a post-control vertex stage - it just resets everything after tessellation has taken place. With tessellation it's different because you are able to subdivide the faces with the shader, so you can use the shader to create more structurally complex models. If you want to use some kind of vertex displacement on it you're going to have a bad time. ![]() The Leadwerks box brush creates a box that has two triangles per face. Tessellation is very similar, but incorporates the control and evaluation stages of the shader. If you liked vertex displacement, you're going to love tessellation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |