Hey guys. I wonder if you guys know a performant way of dynamic decals that work on forward (Built in rendering). I tried mesh decals using Easy decal, it looks nice, bit making that mesh at runtime takes a roll on the frame time https://youtu.be/4tM8I1yY_bA
#Performant decals on forward
1 messages · Page 1 of 1 (latest)
on how many objects do you want to allow decals? i think easy decal is a pretty good bet for that,
but there are some other techniques as well. like texture based decals. but memory requirement is high (new texture per object) and it can look low resolution (you need to use a set of non overlapping uvs so you need a textures that wraps around the whole object)
but also, if you use easy decal, there are 2 or so shaders that let you project decals on a surface without any additional meshes. but the forward variant has a big drawback, shader options are limited and you need to choose I think additive or multiplication blending, which gives weird results. decals wont interact with lighting properly and their color will depend on the color of the surface they are projected on
also i dont see any frame drops in your example
you can also try to change the easy decal code to split up the operation for mesh creation over multiple frames, if possible. not sure which methods are used and if its possible
you can get source code access by contacting the easy decal team and giving a proof of your invoice for easy decal, and make an account on their site
i forgot exactly how it worked but you should find it on their site
I have a question too. the runtime mesh generation, doesn't it only take collider shapes into account? If so, is there a builtin option to use the visual mesh instead of the collision mesh to shape the decal mesh?
I stay below the 11ms frametime window so no framedrop but i have a very capable 5950x and Nvidia 3090. Other computers would have less head room. It took about 0.5 to 1 Ms to bake the mesh on my CPU. Which is just too much of a single frame time
It uses the actual render mesh
There are 12 players and a magazine is 30 round so around 300 decals at any given point would be nice
I have the code btw. Yeah one idea was to move it to a background thread. But there are other problems with mesh decals. If the bullet land on unfortunate places the uv was fubar etc.
ah
you can try texture based decals but they have plenty of drawbacks too like I described
https://github.com/naelstrof/SkinnedMeshDecals
https://www.patreon.com/posts/22015350
painting spots, but also interesting:
https://www.youtube.com/watch?v=YUWfHX_ZNCw
The forward rendering supported decal shader(s) I meant were some of those iirc
- even if you had the texture baed solution, that stretching issue you showed will likely remain, as you still project a flat texture along a certain direction