Page 1 of 13

Triplanar mapping / stochastic texturing

Posted: Wed Dec 25, 2019 11:48 am
by lacilaci
Any news on these 2 features? I know triplanar was in the works but not sure if some progress was made lately...

Re: Triplanar mapping / stochastic texturing

Posted: Thu Dec 26, 2019 2:31 pm
by alpistinho
Sorry, I have been super busy lately and couldn't work on that.

I was hoping to have it done by the end of the year, but I have to merge the Multi UV changes into my triplanar branch.

I'll make an effort to have this done soon

Re: Triplanar mapping / stochastic texturing

Posted: Tue Dec 31, 2019 5:57 am
by lacilaci
alpistinho wrote: Thu Dec 26, 2019 2:31 pm Sorry, I have been super busy lately and couldn't work on that.

I was hoping to have it done by the end of the year, but I have to merge the Multi UV changes into my triplanar branch.

I'll make an effort to have this done soon
Great, I got it working... Will test it out in upcoming days.
Do you think that it could also have control over blend factor? Like how tight is the blend area similar to how cycles has control with it's box mapping blending in image texture node?

Re: Triplanar mapping / stochastic texturing

Posted: Tue Dec 31, 2019 6:20 am
by lacilaci
I'm kinda confused. It still asks for UV map when I use the node... The object needs uv's when using triplanar?

Re: Triplanar mapping / stochastic texturing

Posted: Wed Jan 01, 2020 10:50 am
by Dade
lacilaci wrote: Tue Dec 31, 2019 6:20 am I'm kinda confused. It still asks for UV map when I use the node... The object needs uv's when using triplanar?
Do you mean it needs a mesh with UV coordinates or the texture node has still a mapping option ?

The node mapping type triggers different behaviors: https://github.com/LuxCoreRender/LuxCor ... ar.cpp#L47

GLOBALMAPPING3D and LOCALMAPPING3D works are you expected (i.e. the node mapping is not used).

UVMAPPING3D use the node mapping to transform the point coordinates in UV coordinates.

Re: Triplanar mapping / stochastic texturing

Posted: Wed Jan 01, 2020 11:01 am
by Dade
But the BlendLuxCore pull request (https://github.com/LuxCoreRender/BlendLuxCore/pull/320) hasn't yet been merged ... what version are you using ?

Re: Triplanar mapping / stochastic texturing

Posted: Wed Jan 01, 2020 11:07 am
by lacilaci
Dade wrote: Wed Jan 01, 2020 10:50 am
lacilaci wrote: Tue Dec 31, 2019 6:20 am I'm kinda confused. It still asks for UV map when I use the node... The object needs uv's when using triplanar?
Do you mean it needs a mesh with UV coordinates or the texture node has still a mapping option ?

The node mapping type triggers different behaviors: https://github.com/LuxCoreRender/LuxCor ... ar.cpp#L47

GLOBALMAPPING3D and LOCALMAPPING3D works are you expected (i.e. the node mapping is not used).

UVMAPPING3D use the node mapping to transform the point coordinates in UV coordinates.
When i've put texture in the triplanar node inputs it didn't do anything and when i made some basic uvs for the mesh, texture showed up on object but it was weirdly stretched and had different density on different parts of the mesh.

I'll try to play around with it llater today or sometime tomorrow on few other objects.

I know it wasnt merged, I just created files and copied the code etc manualy. (that actually might be the problem, lol)

Re: Triplanar mapping / stochastic texturing

Posted: Wed Jan 01, 2020 11:13 am
by Dade
You probably need to set the 3 textures to use LOCALMAPPING3D and have the center of the mesh object well placed to have the expected behavior.

Re: Triplanar mapping / stochastic texturing

Posted: Thu Jan 02, 2020 5:48 am
by lacilaci
ok, a simple sphere.
the one on the right has uv mapping (wih seam accross the center which you can clearly see) the one on the left has no uv mapping
spheretriplanar.jpg
1. it's pretty clear that if an object has uv mapping the triplanar mapping is somehow using it as it's different as with an object that has no uv's

2. if object has no uv's the mapping is stretched weirdly

3. 2d texture node in blender doesn't even allow to input 3d mapping

So, maybe I'm doing something wrong, maybe I broke something while "hacking" this thing into blendluxcore from pull request or maybe it's not working properly...? Can someone esle test a basic sphere(or other object) without UV's and using a texture?

EDIT:
Actualy it's a bit different, cause the sphere has some uv mapping already, if I delete the uv's I get no texture projection on the object
spheretriplanar2.jpg

Re: Triplanar mapping / stochastic texturing

Posted: Thu Jan 02, 2020 11:45 pm
by Dade
I have the feeling the BlendLuxCore support is wrong, you have to set the mapping of the triplaner texture node to LOCALMAPPING3D ... but it looks like you don't have a mapping setting there.

I will try to check.

P.S. it is than very important to have the object local reference origin at the center of the sphere.