In the terrain, tessellate those chunks that have trails on them.Perhaps you might store the trail simply as a single (multi-segment) line, and then generate geometry on the fly around it, allowing you to update the mesh in order to respond to such intersections. Intersections of trails might indeed be a problem, but not, I think, one entirely impossible to solve.As the player moves, generate a geometric trail behind them.If so, then essentially what I was envisaging was this: That may mean I won't need to tessellate as much but I'd still have some fairly heavy computations in the domain shader.Īlternatively, what about something similar to what you currently have, but more fitted to this specific purpose: instead of tessellating the geometry into square patches, perhaps generate indented trail geometry, and then procedurally connect that to your terrain, with some partial tessellation in-between in order to improve the transition from one to the other? I can then tessellate but in the domain shader, calculate where the vertices should be based on how close they are to the vector line. Rather than storing the trial graphically in a texture, I could store position points along the trail (perhaps still using a texture). Bearing in mind there may be dozens (or more) trails that cross over each other I could end up tessellating a huge amount at a detailed level which will kill my framerate.ĭoes anyone have any thoughts on how this can be done better or more efficiently? I've been considering some way of altering the position of the vertices in the domain shader to match along some vector that represents the snow trail. If I used 64 tessellation triangles per 1m patch point triangle, I can get slightly better results, but it's obviously slower and you still end up with jagged edges which I really don't want. It's not going to suffice for multiple reasons but mainly a) I've wasted a huge amount of tessellation on areas that aren't part of the trail and b) I end up with jagged lines. It works, I can see a trail: Tonnes of tessellation wasted in areas that don't have a trailīut it looks crap. Once in the domain shader, I ignore the 50% grey value and only shift vertices down if they are 1 (white). In the hull shader, I do a sample of the trail texture at the control points to see if they are ‘on’ the trail (meaning I tessellate), but the problem is that the trial is narrower than the 1m triangle so I need to store a ‘fatter’ trail (using 50% grey or something) around the actual trail in the trail texture so that the control points hit it and the triangle gets tessellated. black for no trail and white for trail) needs to be fairly sizable to stop blockyness. In order to represent snowboard trails using tessellation like this, the texture that represents the snow trails (i.e. In order to give more detail, I'll tesselate in a few more vertices within each 1m square. My terrain is pretty sizeable (8km x 8km) and at the most detailed level, uses 32m x 32m tiles. where the snowboarder falls over, I can do this relatively simply with tessellation and a one-channel grayscale texture representing areas of 1 where the player's legs/arms/body has been and 0 where it hasn't - pretty standard stuff.įor the snowboard trail, it gets a bit more tricky: The other is that of the avatar when he falls, so scattered indentations.įor the organic impressions, i.e. There are two types of trails, one left by a snowboard so square in profile and potentially long with straight edges. I have a requirement to represent snow trails on a terrain.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |