man... your tutorials are unbeatable. They contain the right amount of technical depth. Not just how we do things, but why it works and what errors we would see without proper methods
Could you make a showcase of this on some real world case scenarios? can I use this method to use normal maps more efficiently? Can you show scenes, where the typical normal maps are replaced with your method of projection to create more efficient fake geometry?
That's a really cool idea! However, I'm convinced that 3 texture reads are not a performance bottleneck. The simplest postprocessing shader for outlines starts on 4 reads of screen texture per pixel and modern hardware manages it just fine. Still a cool optimization idea! I learned something today :)
There is a significant difference between taking 4 samples from *the same* texture (as you would do in outlining) and 4 samples from *four different* textures (as you would do for terrain blending). Plus, in terrain blending you not only have a single property/attribute like albedo, but also normal, specular, AO, etc.
Naw, triplanar mapping can be expensive. Texture fillrate is a common a bottleneck on PC games. Texturing a pixel often involves blending of many textures, and many PBR maps per texture used, and sometimes complex smoothing and samples of dirt, mud, scuffs, and decals. Doing math on floats is easy nowadays, total FLOP output is rarely the bottleneck. On RTX 3080, texture fillrate is only ~4x pixel fillrate. So texture fillrate bottlenecks way before pixel fillrate. And on Integrated Graphics / Mobile, texture fillrate turns into a memory bandwidth bottleneck as well, which is killer. Postprocessing edge detection isn't the same comparison; you don't have overdraw and the 4 reads are adjacent (ddx() and ddy() are often considered quite cheap).
Greetings. "sampler2D screen_texture : hint_screen_texture" I would like to take the capture but only of a specific "MeshInstance3D" which the camera is focusing on, do you know how I can do it. Actually making a "dash" of a "MeshInstance3D".
I arrived to this myself, using a little less efficient method, but I can see you have same problem, as in in exact places where there is transition between x-y-z planes there is an artifact line.
Is this possible in Godot 3.5? Version 3.5 dont have MODEL_NORMAL_MATRIX in spatial shader... UPD: oh, in 3.5 i can use render_mode world_vertex_coords;
man... your tutorials are unbeatable. They contain the right amount of technical depth. Not just how we do things, but why it works and what errors we would see without proper methods
this was an absolutely wonderful video. I knew nothing about triplanar mapping, and now I feel like I can go in Godot and experiment with it.
I definitely wouldn't have thought to simplify the texture queries like that. Definitely useful for some cases where you don't want blurred textures.
This is incredible! I have been trying to do just this for days. Thank you
I love such optimization breakdowns. Amazing!
Glad you like them!
Bro. You just saved me from a massive headache! Thanks. ❤
Glad I could help!
Interesting idea, how does it look with a rock texture on the terrain?
You save my life! This is what I am finding! Thanks you so much!
Glad I could help!
Thank you, Mohsen!
your welcome
Could you make a showcase of this on some real world case scenarios? can I use this method to use normal maps more efficiently? Can you show scenes, where the typical normal maps are replaced with your method of projection to create more efficient fake geometry?
Take a look at this tutorial this is one of the use cases of this method:
ruclips.net/video/_-UmK6KAc4M/видео.html
very good. functional explanation.
That's a really cool idea!
However, I'm convinced that 3 texture reads are not a performance bottleneck. The simplest postprocessing shader for outlines starts on 4 reads of screen texture per pixel and modern hardware manages it just fine.
Still a cool optimization idea! I learned something today :)
Thanks
There is a significant difference between taking 4 samples from *the same* texture (as you would do in outlining) and 4 samples from *four different* textures (as you would do for terrain blending). Plus, in terrain blending you not only have a single property/attribute like albedo, but also normal, specular, AO, etc.
Naw, triplanar mapping can be expensive.
Texture fillrate is a common a bottleneck on PC games. Texturing a pixel often involves blending of many textures, and many PBR maps per texture used, and sometimes complex smoothing and samples of dirt, mud, scuffs, and decals. Doing math on floats is easy nowadays, total FLOP output is rarely the bottleneck.
On RTX 3080, texture fillrate is only ~4x pixel fillrate. So texture fillrate bottlenecks way before pixel fillrate.
And on Integrated Graphics / Mobile, texture fillrate turns into a memory bandwidth bottleneck as well, which is killer.
Postprocessing edge detection isn't the same comparison; you don't have overdraw and the 4 reads are adjacent (ddx() and ddy() are often considered quite cheap).
Fetching a sample is one of the most expensive things you can do in a shader
thanks a lot!
I use this info for make my visualshader
Glad it helped!
Conhece o BigLinux baseado no Manjaro? Da uma conferida.
Greetings.
"sampler2D screen_texture : hint_screen_texture" I would like to take the capture but only of a specific "MeshInstance3D" which the camera is focusing on, do you know how I can do it. Actually making a "dash" of a "MeshInstance3D".
What is the benefit?
As this use less texture function it has a higher performace
Wow thank you! Can’t wait for more!
Your welcome
I arrived to this myself, using a little less efficient method, but I can see you have same problem, as in in exact places where there is transition between x-y-z planes there is an artifact line.
I actually like more how my method looks:
float yDot = abs(lNorm.y);
float zDot = abs(lNorm.z);
vec2 uvCords = lVert.yz; float sDot = abs(lNorm.x);
if (yDot - sDot > 0.001) { uvCords = lVert.xz; sDot = yDot; }
if (zDot - sDot > 0.001) { uvCords = lVert.xy; sDot = zDot; }
Is this possible in Godot 3.5?
Version 3.5 dont have MODEL_NORMAL_MATRIX in spatial shader...
UPD:
oh, in 3.5 i can use render_mode world_vertex_coords;
Yeah the same concept can be applied there