triplanar mapping terrain demo

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: triplanar mapping terrain demo

Post by Mel »

It already uses normal maps.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: triplanar mapping terrain demo

Post by Granyte »

i mean to pool wich map coordinate it pick
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: triplanar mapping terrain demo

Post by Mel »

Ah... it could be done also, but that would result IMO in a worse result, the original textures would be much less visible.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: triplanar mapping terrain demo

Post by Granyte »

as far as i know it would only stop the texture change on lod if you poll your normal from a texture instread of from the vertex
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: triplanar mapping terrain demo

Post by Mel »

It still uses the normal of the geometry to calculate the tangent space, so the problem would still be there. Unless you mapped your normal from another texture that covered the whole terrain. Is that what you mean?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: triplanar mapping terrain demo

Post by Granyte »

yes that's what i'm talking about
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: triplanar mapping terrain demo

Post by Mel »

You could create a normal map from the heightmap, and you may calculate another texture sampling coordinate using the size of the terrain and the position of the vertices. Though it is a madness of texture sampling already, but perfectly posible.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: triplanar mapping terrain demo

Post by Granyte »

i know my version does nearly 14 texture sampling for the medium version the high end will have probably 22 or something when the tri planar normal mapping is gonna be added

the good thing is that it still runs a 22 fps on an intel IGP so for me the performance is alrightand i see a couple things i could optimize in the shader code
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: triplanar mapping terrain demo

Post by Mel »

Can you optimize the shader to try and use branching?... 22 reads is quite a lot for a terrain. Terrains should be fast to render because they fill much screen.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: triplanar mapping terrain demo

Post by Granyte »

sadly i cannot and anyway in dx9 branching is somewhat useless

i think that the shader auto optimise some part of it because of the *0 variable deletion and the odd part is that rightnow the cpu seem to be the bottleneck much more then the shader

and as i told i have some useless calculation done multiple times that i can optimise out of the shader

also on the release version there will be 3 version of the shader one low with 4-5 texture read one medium with 14 and a high end with 22
and with the medium currently running between 14 and 30 fps on an intel IGP the low end should be able to run on any hardware while the eye candy of the high end will still be availible for the cazy people with cfx setup like what had
Neomex
Posts: 3
Joined: Mon Oct 22, 2012 3:21 pm

Re: triplanar mapping terrain demo

Post by Neomex »

How does it know when to use which texture?

I have applied it to extracted marching cubes mesh, but at the moment I don't even know what to research.

Basicly, I'm trying to apply texture to a piece of mesh based on corresponding voxels value.
Post Reply