Triplanar mapping / stochastic texturing
Re: Triplanar mapping / stochastic texturing
Should the triplanar mapping be exported with local mapping or all textures? The imagemap texture node export uvmapping2d as default mapping.
Re: Triplanar mapping / stochastic texturing
I'm confused cause here https://github.com/LuxCoreRender/BlendLuxCore/pull/320 in the first screenshot alpistihno shows nodes from 2d mapping and in his render it worked... But then again, this should not use uv's.
By the way all the objects I tried had their origins at their centers.
By the way all the objects I tried had their origins at their centers.
Re: Triplanar mapping / stochastic texturing
I can confirm that there is something wrong with the triplanar mapping. If I use default color input it renders correctly but if I use local mapping it doesn't. If I use same uv index it renders not correctly, too. With different uv index (but same copied uv map) it renders correctly.
When I use standard colors it renders correctly but with images it does not.
When I use standard colors it renders correctly but with images it does not.
Code: Select all
#triplanar with color
scene.textures.1866357581976Color.type = "triplanar"
scene.textures.1866357581976Color.texture1 = 1 0 0
scene.textures.1866357581976Color.texture2 = 0 0 1
scene.textures.1866357581976Color.texture3 = 0 1 0
scene.textures.1866357581976Color.mapping = "globalmapping3d"
scene.textures.1866357581976Color.mapping.transformation = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
#################################################################################################
# image with uv map
scene.textures.1866357603800Color.type = "imagemap"
scene.textures.1866357603800Color.file = "F:\Users\Michael\AppData\Local\Temp\tmp4hm448oa.png"
scene.textures.1866357603800Color.wrap = "repeat"
scene.textures.1866357603800Color.mapping.type = "uvmapping2d"
scene.textures.1866357603800Color.mapping.uvscale = 0.5 -0.5
scene.textures.1866357603800Color.mapping.uvindex = 0
scene.textures.1866357603800Color.mapping.rotation = 0
scene.textures.1866357603800Color.mapping.uvdelta = 0 2
scene.textures.1866357603800Color.channel = "default"
scene.textures.1866357603800Color.gamma = 2.2000000476837158
scene.textures.1866357603800Color.gain = 1
#################################################################################################
# triplanar with local mapping
scene.textures.1866357602808Color.type = "imagemap"
scene.textures.1866357602808Color.file = "F:\Users\Michael\AppData\Local\Temp\tmp4hm448oa.png"
scene.textures.1866357602808Color.wrap = "repeat"
scene.textures.1866357602808Color.mapping.type = "uvmapping2d"
scene.textures.1866357602808Color.mapping.uvscale = 0.5 -0.5
scene.textures.1866357602808Color.mapping.uvindex = 0
scene.textures.1866357602808Color.mapping.rotation = 0
scene.textures.1866357602808Color.mapping.uvdelta = 0 2
scene.textures.1866357602808Color.channel = "default"
scene.textures.1866357602808Color.gamma = 2.2000000476837158
scene.textures.1866357602808Color.gain = 1
#
scene.textures.1866357604792Color.type = "triplanar"
scene.textures.1866357604792Color.texture1 = "1866357602808Color"
scene.textures.1866357604792Color.texture2 = "1866357602808Color"
scene.textures.1866357604792Color.texture3 = "1866357602808Color"
scene.textures.1866357604792Color.mapping = "localmapping3d"
scene.textures.1866357604792Color.mapping.transformation = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
#################################################################################################
# triplanar with same uv map
scene.textures.1866357596360Color.type = "imagemap"
scene.textures.1866357596360Color.file = "F:\Users\Michael\AppData\Local\Temp\tmp4hm448oa.png"
scene.textures.1866357596360Color.wrap = "repeat"
scene.textures.1866357596360Color.mapping.type = "uvmapping2d"
scene.textures.1866357596360Color.mapping.uvscale = 0.5 -0.5
scene.textures.1866357596360Color.mapping.uvindex = 0
scene.textures.1866357596360Color.mapping.rotation = 0
scene.textures.1866357596360Color.mapping.uvdelta = 0 2
scene.textures.1866357596360Color.channel = "default"
scene.textures.1866357596360Color.gamma = 2.2000000476837158
scene.textures.1866357596360Color.gain = 1
#
scene.textures.1866357582968Color.type = "triplanar"
scene.textures.1866357582968Color.texture1 = "1866357596360Color"
scene.textures.1866357582968Color.texture2 = "1866357596360Color"
scene.textures.1866357582968Color.texture3 = "1866357596360Color"
scene.textures.1866357582968Color.mapping = "uvmapping3d"
scene.textures.1866357582968Color.mapping.transformation = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
scene.textures.1866357582968Color.mapping.uvindex = 0
#################################################################################################
# triplanar with different uv map
scene.textures.1866988283512Color.type = "imagemap"
scene.textures.1866988283512Color.file = "F:\Users\Michael\AppData\Local\Temp\tmp4hm448oa.png"
scene.textures.1866988283512Color.wrap = "repeat"
scene.textures.1866988283512Color.mapping.type = "uvmapping2d"
scene.textures.1866988283512Color.mapping.uvscale = 0.5 -0.5
scene.textures.1866988283512Color.mapping.uvindex = 0
scene.textures.1866988283512Color.mapping.rotation = 0
scene.textures.1866988283512Color.mapping.uvdelta = 0 2
scene.textures.1866988283512Color.channel = "default"
scene.textures.1866988283512Color.gamma = 2.2000000476837158
scene.textures.1866988283512Color.gain = 1
#
scene.textures.1866988282520Color.type = "triplanar"
scene.textures.1866988282520Color.texture1 = "1866988283512Color"
scene.textures.1866988282520Color.texture2 = "1866988283512Color"
scene.textures.1866988282520Color.texture3 = "1866988283512Color"
scene.textures.1866988282520Color.mapping = "uvmapping3d"
scene.textures.1866988282520Color.mapping.transformation = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
scene.textures.1866988282520Color.mapping.uvindex = 1
- Attachments
-
- triplanar.blend
- (1.62 MiB) Downloaded 191 times
Re: Triplanar mapping / stochastic texturing
Good, hope this get's solved and we can start using uv-less objects easily.
By the way, is this a good base for stochastic/random texturing like here in fstorm:
tiles: randomized(with locked rotation so pattern is straight): or is this unrelated feature?
By the way, is this a good base for stochastic/random texturing like here in fstorm:
tiles: randomized(with locked rotation so pattern is straight): or is this unrelated feature?
Re: Triplanar mapping / stochastic texturing
I have reworked a bit triplanar texture code and now it works as I expect:
The texture takes a new parameters (".uvindex") to select the UV channel to set (usually 0) and the mapping type should always be "localmapping3d" (the other don't make very much sense):
@Neo, can you merge the pull request, add the support for new ".uvindex" parameter and hard code the "localmapping3d" mapping type ? I don't think it is worth exposing that parameter.
The texture takes a new parameters (".uvindex") to select the UV channel to set (usually 0) and the mapping type should always be "localmapping3d" (the other don't make very much sense):
Code: Select all
scene.textures.tex.type = triplanar
scene.textures.tex.texture1 = tex1
scene.textures.tex.texture2 = tex2
scene.textures.tex.texture3 = tex3
scene.textures.tex.uvindex = 0
scene.textures.tex.mapping.type = localmapping3d
Re: Triplanar mapping / stochastic texturing
It is not related to triplanar mapping but it can be implemented as a special type of mapping
Re: Triplanar mapping / stochastic texturing
Thanks. Can't wait to get my hands on this..Dade wrote: ↑Sat Jan 04, 2020 1:34 pm I have reworked a bit triplanar texture code and now it works as I expect:
image.jpg
The texture takes a new parameters (".uvindex") to select the UV channel to set (usually 0) and the mapping type should always be "localmapping3d" (the other don't make very much sense):
@Neo, can you merge the pull request, add the support for new ".uvindex" parameter and hard code the "localmapping3d" mapping type ? I don't think it is worth exposing that parameter.Code: Select all
scene.textures.tex.type = triplanar scene.textures.tex.texture1 = tex1 scene.textures.tex.texture2 = tex2 scene.textures.tex.texture3 = tex3 scene.textures.tex.uvindex = 0 scene.textures.tex.mapping.type = localmapping3d
- alpistinho
- Developer
- Posts: 198
- Joined: Thu Jul 05, 2018 11:38 pm
- Location: Rio de Janeiro
Re: Triplanar mapping / stochastic texturing
Thanks for the help!
Re: Triplanar mapping / stochastic texturing
Thanks Dade for reworking. There is still something strange. With local mapping it shouldn't matter how the object is transformed but if you rotate the object then the texture gets distorted. Is the hitpoint position or normal evaluated in local or global coordinate frame?
Re: Triplanar mapping / stochastic texturing
I think it may be a problem with the normal not being transformed (only the point is), I will check.