#How to use POM Shader Graph for more realistic
1 messages · Page 1 of 1 (latest)
You're not doing any vertex displacement here.
You need to modify the vertex position
I have it
try changing the normal vector to object space.
Also share your height map
If i turn on shaded wireframe
This doesn't seem like a height map to me
Or at least, it's not gonna produce the effect that you expect
The deeper parts need to be darker.
But it doesn't seem like it's applied to your mesh properly as well.
Possibly due to uv/tiling/offset or LOD settings.
I'd try removing these to make sure you don't mess them up in the material
And set the normal vector space to object.
Then try playing with the displacement multiply parameter(make sure all 3 vector components are set to the same value). Try setting it to 1-10 and see if there is any difference.
It's other texture(cube after this changes)
Ok, so you can see the tesselation/displacement is working on the sphere
Not entirely sure what's going on with the cube. Perhaps it doesn't have enough vertices. Or the height texture is not applied to it.
It's the same material with same textures
maybe try changing the tesselation factor. In fact, I'm not sure about the way you calculate it. Try setting a constant value exposed in the material parameters.
Looking at the wireframe here it does look pretty bad. If it was uniform/grid-like it would have been better, but if the toplogy is gonna be like that, you need more triangles.
So, just find right triangle size?
I think it might be some of the tesselation settings too. For example, "shape factor" seems to spherize the topology, which might not be desirable for a cube.
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@17.3/manual/Tessellation.html
Set the shape to 0
Seems like the displacement is fcked up
Set LOD to 0.
No changes
And get rid of this bullshit
Start simpler.
There are so many factors that could be breaking stuff
Connected just DisplacementMultiply, and it's broked now, so this part is ok
broked?
Just changing texture position
Changing how?
Just texture, no mesh changing. If get closer it's disappeard
Well, that doesn't sound correct, though it's hard to say without seeing it.
So it displaces the whole face? What does the wireframe look like?
What does the shader look like at this point?
If i set 1,1,1 to version before
What's does the shader look like at this point? What are the material settings at this point?
This is not the shader.
Wdym? Like this?
Connect the final displacement back, make sure that vector normal is set to object space, make sure the LOD is set to 0.
For TessellationFactor Normal Vector and View Direction to object space too?
These don't matter right now as you connect the tessellation factor property directly. Keep it that way.
This to tessellation displacement
Is the height map not assigned?
Just normal vector * multiplier
Well, that's not what I suggested.
I realized this I didn't attach this image earlier...
1,1,1 here's
Try making the triangle size smaller
Already
Then increase the tesselation factor to something like 30. And decrease displacement multiply to 0.2, so that it's not making such drastic changes.
Okay... Can you assign the height map to the albedo/base color as well? I want to see if the displacement is aligned with the heightmap.
Hmm... Doesn't seem to be aligned at all
Yeah...
Can you apply just the uv channel to the base color?
No no. I mean sample the texture with uv0
Disconnect the uv input on the base color texture sample
Hmm... Still does not align at all... Are you sure the same texture is applied to the hight map?
Sure
Okay.
I'm off to sleep now. Will try it out myself in the morning.
Okay, good night
Hi, new thoughts?
Yes. So, basically, it's a combination of issues:
- tesselation having a limit on the amount of triangles.
- tesselation producing a non inoform grid topology.
You can see in the screenshots with max tesselation, there are many triangles that overlap crevices and vertices not aligning with where the displacement should have the most effect. Thinking about it, it's totally normal for tesselation, as it's based on triangles and not quads.
So, no way to ensure 3d like texture, that will go beyond the object's boundaries fully?
I mean like bricks, that will complete each other on sides edges
Like this
Or this
Yeah, not really. It doesn't seem like tessellation is good for this situation. It would be a kit easier to create a custom high poly mesh in blender instead.
what about for cube, not the mesh
i know
So... Any way to got shader for effect like this?
The closest you'll get is indeed a tesselation shader, with a high tesselation factor (to have enough mesh density).
But with a simple cube mesh you'll probably end with holes in the corners because the geometry is pushed in two different directions.
You could make some more complex solutions to cover the holes there by warping the tesselation offset, but it might distording the UVs ...
The easiest workaround is to use a flat plane with tesselation for most of the wall, but a dedicated geometry to cover up the corners.
You can also use the less expensive POM effect in the pixel shader for the flat part.
Yeah, to put it simply, there's not enough triangles for the topology of that heightmap. Here I've maxed the tessellation and changed the texture tiling to 0.2 and it looks okayish, but there is still an issue at the edges just like Remmy pointed out.
Besides, that much tesselation(6x the recommended max value), would probably kill performance entirely in a little bit more complicated scene.
If you want an image like the one you shared(#1403785533007597568 message), the best approach would be to make a custom mesh for it. No one does it via tessellation. It's simply an overkill for something that can be achieved so easily with other means.