Hey guys!
I have been working on my “Zerg shader”, which makes heavy use of WorldPositionOffset material input to make an effect of “pulsing organic surface”, and noticed a weird thing.
When my mesh (exported from 3ds max) had one smoothing group (no hard edges), the result was good. But when I change smoothing groups on some polygons, the result becomes weird. I know game engines create duplicate vertices for every UV seam and hard edge, but I’m not sure if this is the reason for this weirdness.
Additional info:
- Nothing else was changed, the mesh is properly welded etc.
- The material does not use normal map.
- Material uses WorldPositionOffset input to animate the geometry via vertices.
PS: If anyone can share a way to achieve good results (like on left pic) while retaining separate smoothing groups, I’d appreciate that.
Bumping the thread, as I’m still waiting for some insight on how/why this issue happens - I’ll be going back to this mesh/material this weekend so hoped to have more information when dealing with it.
As reminder, this is about material that was animated in real-time via WorldPositionOffset input and vertex colors. Bump offset and other texture/pixel-based tricks are not relevant to this issue.
Thanks!
Heya Valentin,
Your assumption about smoothing groups splitting vertices is correct, since they will need to form a hard edge, you double those vertices and give them different normals, which results in them heading in different directions when displaced. The way around it is to only have 1 smoothing group and use a normal map to define any hard edges you may desire. Both 3DSMax and Maya have pipelines for baking normal maps out for just this sort of thing.
Rama’s suggestion is valid as well, you can actually use a multiplier of 0 for tessellation so it will work the same way as your method, though it will require a DX11 video card.
Cheers!
Ian
#Dx11 World Displacement
Dx11 displacement is perfect for rippling organic surfaces!
I’ve used it myself to make a humanoid creature whose entire surface ripples, with multiple smoothing groups involved as well as animations
(this statement alone is a solution for your issue)
Have you tried enabling Dx11 tessellation and using world displacement instead of bump offset?
I’ve found that the displacement method is a lot more consistent and I’ve never been able to get world offset to look good as you show in the pic above.
If you are worried about performance, keep your Tessellation factor very low like 0 or 0.333.
Or better yet
USE the tessellation to your advantage to make an even more organic looking creature!
I have a forum thread on this topic here:
Dx11 Tessellation (lots of pics including material setup and implementation recommendations)
http://forums.epicgames.com/threads/978673-Picture-Gallery-Dx11-Turn-Texture-Detail-into-3D-Vertex-level-Detail-Procedural-HD
#Material Instance Constant
as I explain in tutorial above
I highly recommend you make a material instance constant
because the Dx11 shader takes long time to compile
so set up all your material parameters and make the Tessellation factor itself a parameter, and tweak everything using your material instance constant.
Rama
PS: you are missing out enormously if you have not worked iwth dx11 tessellation and world displacement yet, especially for such an organic creature as you are making!
Hey Rama,
Thanks for suggestion, I’ll check Tesselation once I get a more powerful PC My current one already shuts down / reboots sometimes when I work with Rocket, so I avoid some of heavier features
Just to make sure we’re on the same page, I’m not using BumpOffset node (aka parallax mapping) - I am using World Position Offset, which is a material input (like BaseColor, Metallic, Roughness etc). Here’s the quote from that UDN:
The World Position Offset input allows for the vertices of a mesh to be manipulated in world space by the Material. This is useful for making objects move, change shape, rotate, and a variety of other effects. This is useful for things like ambient animation.
Which is probably why you couldn’t have bump offset look as good, because in this case I don’t simulate it via textures - I actually move vertices. What I’m doing is probably achievable using tesselation as well, but as I said above, I went for the less “risky” (for my PC) and more known (to me) way to handle it.