Triplanar mapping / stochastic texturing

Discussion related to the LuxCore functionality, implementations and API.
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 »

Dade wrote: Sat Jan 04, 2020 4:51 pm
neo2068 wrote: Sat Jan 04, 2020 4:13 pm Is the hitpoint position or normal evaluated in local or global coordinate frame?
I think it may be a problem with the normal not being transformed (only the point is), I will check.
I should have fixed the problem.
Support LuxCoreRender project with salts and bounties
neo2068
Developer
Developer
Posts: 260
Joined: Tue Dec 05, 2017 6:06 pm
Location: Germany

Re: Triplanar mapping / stochastic texturing

Post by neo2068 »

Yes, it works as expected, now. I set local mapping as default for triplanar mapping but leave 3d mapping node. if someone wish to use global mapping or uv mapping for some reason he can plugin a 3d mapping node.
i7 5820K, 32 GB RAM, NVIDIA Geforce RTX 2080 SUPER + GTX 1080, Windows 10 64bit, Blender 2.83.5
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 »

neo2068 wrote: Sun Jan 05, 2020 12:15 pm Yes, it works as expected, now. I set local mapping as default for triplanar mapping but leave 3d mapping node. if someone wish to use global mapping or uv mapping for some reason he can plugin a 3d mapping node.
How do you scale the map/texture tiling?
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: Sun Jan 05, 2020 12:32 pm
neo2068 wrote: Sun Jan 05, 2020 12:15 pm Yes, it works as expected, now. I set local mapping as default for triplanar mapping but leave 3d mapping node. if someone wish to use global mapping or uv mapping for some reason he can plugin a 3d mapping node.
How do you scale the map/texture tiling?
You can scale the "localmapping3d" additional transformation or scale the the UV mapping of the 3 child nodes (to have decoupled control of the scale of the 3 axes).
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 »

Ooohh, it seems to be working really good guys. (just a quick test so far)

I love this feature instantly.

I don't see much reason for 3 different texture inputs though and also why this should be a separate node.

This could easily be a checkbox in image node and thus making the texture being used as projection in all 3 axes and switching existing "2D mapping" input from image node to a "3D mapping" input
(maybe for the sake of flexibility also keep separate node)

Does rotating axes in local mapping rotate each respective projection or does it rotate texture completely?

Using it on bump mapping produces this weird "seam"?
B.jpg
using on diffuse everything seems ok
C.jpg
Pleeeeease tell me you can fix this.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post by lacilaci »

It almost seems as if the bump mapping flips at the seam.
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 »

It seems to work fine here:

bump.jpg

The mapping direction is also consistent among sides (notice the 0,0 => 1,1 position on side, top, etc.):

bump2.jpg

How do you trigger the problem ?
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: Mon Jan 06, 2020 10:26 am It seems to work fine here:


bump.jpg


The mapping direction is also consistent among sides (notice the 0,0 => 1,1 position on side, top, etc.):


bump2.jpg


How do you trigger the problem ?
Squash the ball in vertical axis for example so that the projections from sides get stretches almost to the center, then it starts breaking with bump mapping... If you have problem replicating I will post some example scene later. I'm busy and also testing some animations with luxcore.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post by lacilaci »

Another issue with this, related to opencl

opencl
opencl.jpg
cpu
cpu.jpg
scene is a mess cause I'm testing animations in it chairs are instances and parented to empty objects that are animated(rotation). Cpu seems to handle it ok but opencl somehow freaks out.

here's quick animation, where you can see almost as if one side is missing projection or something(it's near black) on cpu this doesn't happen
vid.mp4
(468.45 KiB) Downloaded 171 times
I can't share the scene cause of the chair, but I might try to replicate this on a primitive object tomorrow... If I can.

By the way, the scene has a bakeg gi, but none of chair materials are using it (so that it is stable during anim.) if it's of any significance.
EDIT: this is definitely related to animation, cause when I move camera it looks ok at first but when I slide animation and render another frame then again a side of the object goes black. Maybe it's because chair parts are parented to the animated object? So might be related to how the hierarchy is exported from blender?? IT's however unrelated problem to the original bump mapping seam
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post by lacilaci »

Ok, just hit render and observe :D
bumptest.rar
(1.99 MiB) Downloaded 169 times
So the first problem seems to be related to high repetition or high frequency of details in a texture.
The second one, where the whole triplanar map gets weird is probably due to animation and parents..

the scene is set to render mid animation frame so you should clearly see all what's going wrong.
Post Reply