Triplanar mapping / stochastic texturing

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

Re: Triplanar mapping / stochastic texturing

Post by lacilaci »

I think I know what's the problem, maybe... Or maybe it's yet another issue...

Even if you want to use triplanar mapping, you still get f*d up shading if your mesh doesn't have uv's and material uses bump. This is pretty bad problem. cause the whole point of triplanar is not to worry about unwrapping simple meshes.
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 Jan 07, 2020 8:04 am Even if you want to use triplanar mapping, you still get f*d up shading if your mesh doesn't have uv's and material uses bump. This is pretty bad problem. cause the whole point of triplanar is not to worry about unwrapping simple meshes.
Yes, LuxCore extracts some important information out of UV mapping (i.e. surface differential): https://github.com/LuxCoreRender/LuxCor ... sh.cpp#L52

See the code ? If the mesh has not UV, it falls back to a constant UV values. Surface differentials are used, among other thing, to build the bump mapping local reference system. With constant values (i.e. lack of information how the surface is oriented) it will rotate according the dominant orientation of the surface (producing the what you have observed).

I could try, instead to fall back to constant UV values, to use triplanar mapping to automatically generate meaningful UV coordinates when they are not available :idea:
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: Tue Jan 07, 2020 9:27 am
lacilaci wrote: Tue Jan 07, 2020 8:04 am Even if you want to use triplanar mapping, you still get f*d up shading if your mesh doesn't have uv's and material uses bump. This is pretty bad problem. cause the whole point of triplanar is not to worry about unwrapping simple meshes.
I could try, instead to fall back to constant UV values, to use triplanar mapping to automatically generate meaningful UV coordinates when they are not available :idea:
yes please. No one will expect the need to use/build uvmap while also 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: Mon Jan 06, 2020 12:38 pm Another issue with this, related to opencl

opencl

cpu
I fixed a problem in OpenCL code and now the output is the same. Can you check if this has solved the "seams" problem too, it working fine here:

ellips.jpg
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: Tue Jan 07, 2020 11:14 am
lacilaci wrote: Mon Jan 06, 2020 12:38 pm Another issue with this, related to opencl

opencl

cpu
I fixed a problem in OpenCL code and now the output is the same. Can you check if this has solved the "seams" problem too, it working fine here:


ellips.jpg
Oh, fantastic. I will get back to this once build is ready and on dailies. :)
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: Triplanar mapping / stochastic texturing

Post by juangea »

Can we test this already in the blender addon?
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Triplanar mapping / stochastic texturing

Post by B.Y.O.B. »

juangea wrote: Tue Jan 07, 2020 12:37 pm Can we test this already in the blender addon?
Yes, in latest daily, with Add Node > Mapping > Triplanar.
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: Triplanar mapping / stochastic texturing

Post by juangea »

Awesome, thanks!
epilectrolytics
Donor
Donor
Posts: 790
Joined: Thu Oct 04, 2018 6:06 am

Re: Triplanar mapping / stochastic texturing

Post by epilectrolytics »

Works great with textures and bump, but I can't get normal maps to work (wrong intput warning and no visible effect).
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 »

epilectrolytics wrote: Tue Jan 07, 2020 2:47 pm Works great with textures and bump, but I can't get normal maps to work (wrong intput warning and no visible effect).
I don't think it can work with normal mapping because triplanar is a blend of 3 textures and you can not blend normal maps like if the where images: the blend of normal map pixels is not the interpolated normal.

P.S. however the wrong input warning sounds strange.
Support LuxCoreRender project with salts and bounties
Post Reply