triplanar mapping terrain demo
triplanar mapping terrain demo
Some people asked me about how to use the triplanar mapping shader i made the other day, so, i thought it would be nice to have a demo that showed the whole thing in motion.
This is an image of it in action.
It is an Irrlicht terrain mapped with this shader, in a foggy environment. I have scaled the terrain so it covers a large area just it doesn't feel as small as the terrain example gives. Irrlicht can display really large terrains on its own, just give it the chance to do so
http://omegasection.g0dsoft.com/demos/triplanarDemo.zip
I have tried to make the demo fully portable, but i haven't actually tested it on linux, so no linux binar, only windows. The source code provided has no projects, though it shouldn't be too hard to test. I hope.
And of course, i can't tell if it will work or not, but that is what the source code is there for . Just in case, the 6 textures version needs irrlicht to be recompiled to support 6 textures at least
This is an image of it in action.
It is an Irrlicht terrain mapped with this shader, in a foggy environment. I have scaled the terrain so it covers a large area just it doesn't feel as small as the terrain example gives. Irrlicht can display really large terrains on its own, just give it the chance to do so
http://omegasection.g0dsoft.com/demos/triplanarDemo.zip
I have tried to make the demo fully portable, but i haven't actually tested it on linux, so no linux binar, only windows. The source code provided has no projects, though it shouldn't be too hard to test. I hope.
And of course, i can't tell if it will work or not, but that is what the source code is there for . Just in case, the 6 textures version needs irrlicht to be recompiled to support 6 textures at least
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: triplanar mapping terrain demo
Looks good.... but what is triplanar mapping?
"this is not the bottleneck you are looking for"
Re: triplanar mapping terrain demo
Triplanar mapping is a technique where the mapping coordinates are aligned to the axes and blended together using the normals of the objects so the textures can avoid parallel projections on the polygons.
I can't explain it simpler... ^^U
I can't explain it simpler... ^^U
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: triplanar mapping terrain demo
Haha, way to explain in plain English for the dude who CBA to google
Re: triplanar mapping terrain demo
this is very cool and I have implemented it into my object system already. Very nicely done!
I am not a shader guru, and would like to know how I would add dynamic lighting capability to this?
I am not a shader guru, and would like to know how I would add dynamic lighting capability to this?
Re: triplanar mapping terrain demo
By editing the shaders to run with your lighting system, sadly.
Re: triplanar mapping terrain demo
The system already allows to change the light direction in real time. And to change the colors, you can use the object's material. in fact, i think the best way is to create a triplanar mapping system aimed to a deferred rendering, so you can add as much lights as you want without the need to touch the triplanar code. I could try and figure out that...
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: triplanar mapping terrain demo
look pretty nice but why are you using the vertex normal to select the texture?
with the irrlicht terrain it makes the texture change when you move
with the irrlicht terrain it makes the texture change when you move
Re: triplanar mapping terrain demo
I would love to help, but unfortunately, I am just now learning about shaders. I would be interested in seeing any progress that you make however, I MIGHT even be able to add some little thing.Mel wrote:The system already allows to change the light direction in real time. And to change the colors, you can use the object's material. in fact, i think the best way is to create a triplanar mapping system aimed to a deferred rendering, so you can add as much lights as you want without the need to touch the triplanar code. I could try and figure out that...
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: triplanar mapping terrain demo
@hendu, I googled "Triplanar mapping" and I could not find anything worth looking at, I found some results for UDK....
But what I was hoping for was something like this https://www8.cs.umu.se/kurser/5DV051/VT ... apping.pdf
*above example is for parallax mapping, obviously.*
And @mel, thank you for the explanation.
But what I was hoping for was something like this https://www8.cs.umu.se/kurser/5DV051/VT ... apping.pdf
*above example is for parallax mapping, obviously.*
And @mel, thank you for the explanation.
"this is not the bottleneck you are looking for"
Re: triplanar mapping terrain demo
Yeah, those results are kinda bad actually. Anyway in plain english, it helps remove texture stretching on near-vertical terrain.
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: triplanar mapping terrain demo
And now I can thank you too, hendu.
And since know what it is good for I gotta learn how to do it *shouldn't be too hard*
And since know what it is good for I gotta learn how to do it *shouldn't be too hard*
"this is not the bottleneck you are looking for"
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Re: triplanar mapping terrain demo
Hi, Interesting...
The only "bad" thing is the LOD of the terrain that change the topology of the terrain all the time when we move. Is it the Irrlicht terrain that's doing that? Or something in the shader.
Looking at it, it seem to change the textures based on the face normals (perhaps). Would have been nice to have a FPS meter to see how much this technique takes...
The 6 textures version is really beautiful (when we don't move)
The only "bad" thing is the LOD of the terrain that change the topology of the terrain all the time when we move. Is it the Irrlicht terrain that's doing that? Or something in the shader.
Looking at it, it seem to change the textures based on the face normals (perhaps). Would have been nice to have a FPS meter to see how much this technique takes...
The 6 textures version is really beautiful (when we don't move)
Re: triplanar mapping terrain demo
It is Irrlicht doing that, in fact you can apply the shader to any mesh you want.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: triplanar mapping terrain demo
or you can mak the thing use normal map that's how i did it on my planetary generator