Page 4 of 13

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 8:04 am
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.

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 9:27 am
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:

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 9:30 am
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...

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 11:14 am
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

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 11:18 am
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. :)

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 12:37 pm
by juangea
Can we test this already in the blender addon?

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 1:02 pm
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.

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 2:30 pm
by juangea
Awesome, thanks!

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 2:47 pm
by epilectrolytics
Works great with textures and bump, but I can't get normal maps to work (wrong intput warning and no visible effect).

Re: Triplanar mapping / stochastic texturing

Posted: Tue Jan 07, 2020 3:07 pm
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.