Triplanar mapping / stochastic texturing

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Triplanar mapping / stochastic texturing

Post by lacilaci »

Any news on these 2 features? I know triplanar was in the works but not sure if some progress was made lately...
User avatar
alpistinho
Developer
Developer
Posts: 198
Joined: Thu Jul 05, 2018 11:38 pm
Location: Rio de Janeiro

Re: Triplanar mapping / stochastic texturing

Post 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
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post 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?
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post 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?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post 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.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post by Dade »

But the BlendLuxCore pull request (https://github.com/LuxCoreRender/BlendLuxCore/pull/320) hasn't yet been merged ... what version are you using ?
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post 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)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post 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.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post 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
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post 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.
Support LuxCoreRender project with salts and bounties
Post Reply