- Home /
Tessallation without DX11?
Hello,
In short I'm generating a large plane with random heights for each vertex as a terrain object, I need to increase the level of density of vertices around the player for a smoother looking terrain.
Does anyone know of any example shaders that can tessalate without using DirectX 11? Surely the method behind it is fairly fundamental. If an example shader of such does not exist for Unity then could someone point me in the right direction as to where I may study the basic principles, so I don't have to haphazardly piece together my own variation. :P
Thanks.
Edit: In fact, it could do the opposite. I could generate the highest level of detail and work down instead of up.
It's impossible, you need shader level 4 (I think) and no older version of DX supports that
Thanks for the advice so far, could you be a little more specific? And what about going the other way? Could I reduce vertex density using a shader.
Answer by Bunny83 · Jun 05, 2013 at 04:00 PM
It's not possible in "normal" shaders. The usual Vertex and Fragment-shaders are not capable of creating new geometry since they are just pipeline processors of the incoming vertex data. The Vertex shader can only process one vertex at a time and has no information of the other vertices or triangles. The Fragment shader has no idea of vertex or triangles at all. It just processes an interpolated fragment inside a triangle.
What you need is a geometry shader which is not available before DX10
DX10 is completely fine, it's just 11 I'm trying to avoid. Any tips on places to start looking into dx10 geometry shaders? Tessalation would be nice but decimation is fine as well.
Edit: Both would be even better after thinking about it. Tessalate up close and decimate the outer regions. Therefore I'm not generating a high poly terrain at start, but I can still generate detailed terrain with a mid range poly count.
Just had a browse around, it seems as though Unity has skipped out on dx11 altogether. Is it true that it only supports shader level 4 through dx11?
Answer by alienorbit · Jun 07, 2013 at 12:09 PM
Why would you have to rely on shaders? It should be entirely possible to "pre-process" a given mesh when loading a scene.
check out Mega-fiers for one plugin solution
EDIT: I understand the intention of the original post better now, and can see how shaders would be add awesomeness.
No need to rely on shaders, just had a preference. But seeing as shader level 4 is only supported by DX 11 in Unity I'll have to 'pre-process' it anyway. No big deal. :)
@alienorbit because shaders are faster if used for the right purpose. They also run parallel to the game meaning there will be no performance decrease (unless you've god a bad GPU).
But for something like this, there is no point... why not just use LOD's?
Another reason to rely on shaders is because they are awesome!!! XD
We'll the plan is to generate chunks of terrain, each with 4 levels of vertex densities, swapping between the levels based on distance from the Camera. I obviously cannot use the built in LoD system for 2 reasons. One, it only works on pre-generated content that you've already made different densities for, not procedural stuff. And it's a pro only feature.