Triplanar mapping / stochastic texturing

Discussion related to the LuxCore functionality, implementations and API.
User avatar
B.Y.O.B.
Developer
Posts: 3681
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Triplanar mapping / stochastic texturing

Post by B.Y.O.B. » Tue Jan 14, 2020 5:56 pm

kintuX wrote:
Tue Jan 14, 2020 4:56 pm
Edit
Ah, the Bump seems to have no effect where textures blend.
Your node setup looks wrong, follow the one Dade posted above in this post: viewtopic.php?f=5&t=1638&start=90#p19295

kintuX
Posts: 577
Joined: Wed Jan 10, 2018 2:37 am

Re: Triplanar mapping / stochastic texturing

Post by kintuX » Tue Jan 14, 2020 6:38 pm

B.Y.O.B. wrote:
Tue Jan 14, 2020 5:56 pm
kintuX wrote:
Tue Jan 14, 2020 4:56 pm
Edit
Ah, the Bump seems to have no effect where textures blend.
Your node setup looks wrong, follow the one Dade posted above in this post: viewtopic.php?f=5&t=1638&start=90#p19295
Yup, that works :) Thanks for pointing out the correction.
Triplanar_test-DadeNodeTree_OK_LC.jpg
Also, bump works fine both ways (as Value or Height) utilizing CC0textures - "Edit2" on the previous post. Just didn't dive in, to find out what the difference might be - if any :?

User avatar
Dade
Developer
Posts: 4488
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post by Dade » Tue Jan 14, 2020 8:05 pm

kintuX wrote:
Tue Jan 14, 2020 4:56 pm
Q: Is there any control to manipulate the overlay blending like it can be done with Cycles (Blend value)?
At the moment it is a double square blending (i.e. quite fast) but it is easy to add different types of blending if needed.
Support LuxCoreRender project with salts and bounties

kintuX
Posts: 577
Joined: Wed Jan 10, 2018 2:37 am

Re: Triplanar mapping / stochastic texturing

Post by kintuX » Tue Jan 14, 2020 9:51 pm

Dade wrote:
Tue Jan 14, 2020 8:05 pm
kintuX wrote:
Tue Jan 14, 2020 4:56 pm
Q: Is there any control to manipulate the overlay blending like it can be done with Cycles (Blend value)?
At the moment it is a double square blending (i.e. quite fast) but it is easy to add different types of blending if needed.
This type is fine. What I meant by Blend value is the influence of it, from 0 (no XYZ blending) to 1 (full XYZ blending). And now when I think about it, blending distance and/or yes, different types or even masking (using texture or a procedural noise, if possible) I'd find quite beneficial 8-)
Especially, since I found out it works really good with displacement :D

Although again, here's incoherence between CPU vs OCL:

- CPU
triplanar_CPU.jpg
- OCL
triplanar_OCL.jpg
Scene attached here.

User avatar
lacilaci
Donor
Posts: 1930
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post by lacilaci » Wed Jan 15, 2020 6:27 am

EDIT: had some unknown issues

Anyway, it seems to work I think well on cpu but not opencl(still shows weir seam when no uv's are present)

User avatar
Dade
Developer
Posts: 4488
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post by Dade » Wed Jan 15, 2020 11:09 am

kintuX wrote:
Tue Jan 14, 2020 9:51 pm
Although again, here's incoherence between CPU vs OCL:

- CPU
triplanar_CPU.jpg

- OCL
triplanar_OCL.jpg

Scene attached here.
I have investigate the problem and, unfortunately, setting the bump height to 1 is not enough for OpenCL code, the triplanar texture must be really plugged directly into material socket. With OpenCL you are getting the normal bump mapping because of the scale node between the triplanar texture and the material (even if the scale value is 1, this trick to neutralize the node only for CPU code).

@B.Y.O.B.: this requires a support from BlendLuxCore, it could be a new "Bump" node type, something like "UV-less Bump" node. The new node could have directly 3 sockets and 3 scales and should produce different LuxCore scene output with the triplanar texture directly connected to the material and the 3 scale nodes connected to the triplanar texture.
Support LuxCoreRender project with salts and bounties

juangea
Donor
Posts: 168
Joined: Thu Jan 02, 2020 6:23 pm

Re: Triplanar mapping / stochastic texturing

Post by juangea » Wed Jan 15, 2020 12:07 pm

I would like to make a proposal for a slightly improvement in the triplanar workflow, I think vray works this way.

In case just 1 texture is plugged into the first slot, then that texture will be used for the three inputs, if you have more than one, then it will consider the three inputs separatedly.

This may save some clicks, not a big deal, but could be a good improvement, the first socket could be called "Texture 1 (master)"

Hope you like the idea :)

User avatar
lacilaci
Donor
Posts: 1930
Joined: Fri May 04, 2018 5:16 am

Re: Triplanar mapping / stochastic texturing

Post by lacilaci » Wed Jan 15, 2020 12:11 pm

I would actually like to know if there is a practical reason to use 3 different textures. I never needed 3 different textures to be projected with triplanar node. You need 3 rotations, and scaling etc for some cases, but different textures.. what for?

juangea
Donor
Posts: 168
Joined: Thu Jan 02, 2020 6:23 pm

Re: Triplanar mapping / stochastic texturing

Post by juangea » Wed Jan 15, 2020 12:29 pm

Oh yes there is, it simplifies mixing procedural textures in some situations, like in nature creation (rocks, tree barks...) , you can use different textures to create more variety, I would not disable that option, just simplify it for when you want to use just one texture.

User avatar
Dade
Developer
Posts: 4488
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Triplanar mapping / stochastic texturing

Post by Dade » Wed Jan 15, 2020 3:42 pm

juangea wrote:
Wed Jan 15, 2020 12:29 pm
Oh yes there is, it simplifies mixing procedural textures in some situations, like in nature creation (rocks, tree barks...) , you can use different textures to create more variety, I would not disable that option, just simplify it for when you want to use just one texture.
Yes, snow is a classic example: you use snow from the top and grass/terrain from the side.
Support LuxCoreRender project with salts and bounties

Post Reply