Page 2 of 2

Re: triplanar mapping terrain demo

Posted: Tue Feb 19, 2013 7:56 pm
by Mel
It already uses normal maps.

Re: triplanar mapping terrain demo

Posted: Wed Feb 20, 2013 3:26 am
by Granyte
i mean to pool wich map coordinate it pick

Re: triplanar mapping terrain demo

Posted: Wed Feb 20, 2013 11:01 am
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.

Re: triplanar mapping terrain demo

Posted: Wed Feb 20, 2013 6:55 pm
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

Re: triplanar mapping terrain demo

Posted: Wed Feb 20, 2013 7:54 pm
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?

Re: triplanar mapping terrain demo

Posted: Wed Feb 20, 2013 9:01 pm
by Granyte
yes that's what i'm talking about

Re: triplanar mapping terrain demo

Posted: Thu Feb 21, 2013 8:33 am
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.

Re: triplanar mapping terrain demo

Posted: Thu Feb 21, 2013 6:13 pm
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

Re: triplanar mapping terrain demo

Posted: Thu Feb 21, 2013 6:54 pm
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.

Re: triplanar mapping terrain demo

Posted: Thu Feb 21, 2013 8:12 pm
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

Re: triplanar mapping terrain demo

Posted: Fri Dec 27, 2013 6:01 pm
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.