Jump to content

Displacement shader not working in game


YouGroove
 Share

Recommended Posts

The subdivision is really a function of the original vertex density of the surface. The sphere has a lot of vertices. Those big flat walls have only four vertices each. So it is working, but it doesn't work very well on a large flat surface with no subdivision.

 

There is also the problem of lining up edges. The edges of those walls will have cracks in them where the surface is raised.

 

So at this time, tessellation tends to be good for dense models, but not so good for large flat surfaces.

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

This somehow reminds me of a blog about the abuse of tessellation in Crysis 2 :-)

 

http://techreport.com/review/21404/crysis-2-tessellation-too-much-of-a-good-thing/2

 

An idea might to include the displacement map resolution in the calculation of the tessellation factors: Check how many pixels would lie on the edges of a patch and tessellate accordingly (of course lower those factors depending on viewing distance). I was planning to use something like that for my terrain experiments.

Link to comment
Share on other sites

I thaught subdivision work was to subdivide any surface like modeling programs do easyly eevn on planar simple surface. I'm really disappointed about that "magic" shader laugh.png

 

An idea might to include the displacement map resolution in the calculation of the tessellation factors: Check how many pixels would lie on the edges of a patch and tessellate accordingly (of course lower those factors depending on viewing distance). I was planning to use something like that for my terrain experiments.

 

this is exactly what i thaught.

Actually displacement map seems to work more like some height map in fact to have height for your surface or model vertices. Have a displacement map to say how to subdivide from 0 to a lot for small details on texture indeed would be the best system for a real use.

 

----------------------

 

What an incredible waste of processing power and GPU for almost planar surface, the most bad exemple of displacement as it should not be used for that model laugh.png

newbarrier-mesh.jpg

Stop toying and make games

Link to comment
Share on other sites

Since it's shader-driven, it should be possible to calculate the screen area of a triangle and use that to decide how fine the tessellation should be. I just haven't figured out an equation I am happy with yet.

 

Yes, Crytek made a poor implementation. You could tell that PC was not their first concern. :(

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

The subdivision is really a function of the original vertex density of the surface. The sphere has a lot of vertices. Those big flat walls have only four vertices each. So it is working, but it doesn't work very well on a large flat surface with no subdivision.

 

There is also the problem of lining up edges. The edges of those walls will have cracks in them where the surface is raised.

 

So at this time, tessellation tends to be good for dense models, but not so good for large flat surfaces.

 

 

ahhhh makes sense :) is there a tesselation shader coming ? was wondering because I had the same issue

https://www.dropbox.com/s/8kzciw8fqom18nj/Screenshot%202014-04-08%2017.43.30.png

 

but sure no subdivision no displacement.

It doesn´t work... why? mhmmm It works... why?

Link to comment
Share on other sites

We must mix displacement shader and tesselation.

Tesselation goal is to subdivide any plane or low poly cylinder.

While displacement is another technique to just move vertices according to your displacement map like terrain with heightmap.

 

The shader i expected and the more usefull way :

As you can see the texture that is the displacement map will control height of vertices on the cube, but the flat cube is automatically subdivided by the shader :

unity_dx11_tesselation_shader_100times.jpg

 

Could we have such shader in LE3 ?

 

Why not proposing a tesselation shader only that can find some good uses ?

tesselation_froblin.gif

 

 

Some good application example tesselation : terrain

 

Actually LE3 is displacement only, but don't have per model tesselation option.

That would allow super rounded pipes, characters, space ship or anything else or some rounding some model parts of them.

 

Well something to ask as suggestion feature.

Stop toying and make games

Link to comment
Share on other sites

The LE3 displacement shader already tessellates, but probably the algorithm and its configurability could be improved upon (as Josh stated above).

 

And yeah, that tessellated terrain is nice, but it's a pretty complicated algorithm (described in Shader X7), since they first render a point cloud in a first pass to get info on the terrain structure, and then calculate the tessellation factors in a second pass.

Link to comment
Share on other sites

It's difficult to design a tessellation shader that requires no special settings to work with everything. I'm thinking the maximum onscreen width/height should be an acceptable input, and from there the tess factor can be calculated.

  • Upvote 2

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...