Re: Triplanar mapping / stochastic texturing
Posted: Fri Jan 03, 2020 5:51 am
Should the triplanar mapping be exported with local mapping or all textures? The imagemap texture node export uvmapping2d as default mapping.
Show your work, get help, participate in development
https://forums.luxcorerender.org/
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
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
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