random rotation texture tiles
random rotation texture tiles
Is there a function in skindigo to randomly rotate a texture at point of render?
I'm working on a large tiled floor area. They use the same patterned tile throughout but they are laid with a random rotation.
I can aproxuimate the effect by ganging up several tiles in a texture image but when I do a high arial view you can see the repeat and the file is obviously just massive.
Is there a function to do this within Indigo? Is it a Shader function?
Also I assume truely random would be a bad idea? Would that mean the tiles could change orientation from render to render?
Below is a diagram of the effect I am looking to achieve: Tiles with any rotation just repeating across a floor
I'm working on a large tiled floor area. They use the same patterned tile throughout but they are laid with a random rotation.
I can aproxuimate the effect by ganging up several tiles in a texture image but when I do a high arial view you can see the repeat and the file is obviously just massive.
Is there a function to do this within Indigo? Is it a Shader function?
Also I assume truely random would be a bad idea? Would that mean the tiles could change orientation from render to render?
Below is a diagram of the effect I am looking to achieve: Tiles with any rotation just repeating across a floor
- Attachments
-
- random-rotation.png (3.68 KiB) Viewed 7239 times
Re: random rotation texture tiles
Adding a functionality to define X textures to use from in the tiling and I'm happy too
polygonmanufaktur.de
Re: random rotation texture tiles
Should be pretty easy to do in ISL at least
-
- Posts: 1828
- Joined: Mon Sep 04, 2006 3:33 pm
Re: random rotation texture tiles
Ah that'd be amazing for tiles / floorboards / bricks. A kind of MultiTexture for Indigo.OnoSendai wrote:Should be pretty easy to do in ISL at least
Re: random rotation texture tiles
Here's a first crack at it.
Randomly selects from 3 textures, with a random orientation for each texture.
Shader looks like so (may have bugs!)
Randomly selects from 3 textures, with a random orientation for each texture.
Shader looks like so (may have bugs!)
Code: Select all
def rotate(real r, vec2 st) vec2:
let
s = x(st)
t = y(st)
in
if(r < 0.5,
if(r < 0.25,
vec2(s, t),
vec2(t, -s)
),
if(r < 0.75,
vec2(-s, -t),
vec2(-t, s)
)
)
def eval(vec3 pos) vec3 :
let
uv = getTexCoords(0)
st = rotate(gridNoise(uv), uv)
NUM_TEXTURES = 3
tex_index = floorToInt(gridNoise(vec2(x(uv) + 45655.0, y(uv) + 3257.0)) * real(NUM_TEXTURES))
in
sample2DTextureVec3(tex_index, st)
- Attachments
-
- random_tiling_texture_test.pigs
- (299.85 KiB) Downloaded 316 times
Re: random rotation texture tiles
Damn that was quick
Will have a deeper look into it soon!
Thanks a lot Ono!!!
Will have a deeper look into it soon!
Thanks a lot Ono!!!
polygonmanufaktur.de
Re: random rotation texture tiles
Amazing!
Thank you so Much
Thank you so Much
Re: random rotation texture tiles
and mirroring function?
Re: random rotation texture tiles
Mirroring is easy to add if needed.snorky wrote: and mirroring function?
-
- Posts: 1828
- Joined: Mon Sep 04, 2006 3:33 pm
Re: random rotation texture tiles
Awesome!OnoSendai wrote:Here's a first crack at it.
Randomly selects from 3 textures, with a random orientation for each texture.
Shader looks like so (may have bugs!)
Code: Select all
def rotate(real r, vec2 st) vec2: let s = x(st) t = y(st) in if(r < 0.5, if(r < 0.25, vec2(s, t), vec2(t, -s) ), if(r < 0.75, vec2(-s, -t), vec2(-t, s) ) ) def eval(vec3 pos) vec3 : let uv = getTexCoords(0) st = rotate(gridNoise(uv), uv) NUM_TEXTURES = 3 tex_index = floorToInt(gridNoise(vec2(x(uv) + 45655.0, y(uv) + 3257.0)) * real(NUM_TEXTURES)) in sample2DTextureVec3(tex_index, st)
Re: random rotation texture tiles
Hi Folks...
Thanks so much what the ffort above... It does exactly what I would like to do.
However:
When I try to use the shader above I just get a black face... I assume its becuase it can't find the texures?
I'm using sketchup and relatively new to Indigo. Could someone give me a clue as how to apply several textures to a material please.
Thanks so much what the ffort above... It does exactly what I would like to do.
However:
When I try to use the shader above I just get a black face... I assume its becuase it can't find the texures?
I'm using sketchup and relatively new to Indigo. Could someone give me a clue as how to apply several textures to a material please.
Re: random rotation texture tiles
The code above isn't the full shader to copy & paste that way!
There are also texture definitions inside the igs file.
best to open the pigs above in Indigo, pick the material and save it as a separate file to analyze it.
Afaik Exporters aren't capable of importing/exporting multiple textures atm!
Ono, is there a Exporter friendly way of defining the textures directly in the Shader?
There are also texture definitions inside the igs file.
best to open the pigs above in Indigo, pick the material and save it as a separate file to analyze it.
Afaik Exporters aren't capable of importing/exporting multiple textures atm!
Ono, is there a Exporter friendly way of defining the textures directly in the Shader?
Code: Select all
<scenedata>
<material>
<uid>5</uid>
<name>mat1</name>
<diffuse>
<texture>
<path>C:\Users\Zom-B\AppData\Local\Temp\indigo_temp_dir\indigo_temp_dir_1357756186\PACKED_1_ColorChecker_sRGB_from_Ref_lzw.tiff</path>
<a>-0</a>
<b>1</b>
<c>-0</c>
<uv_set_index>0</uv_set_index>
<exponent>2.2</exponent>
<tex_coord_generation>
<uv>
<matrix>1 0 0 1</matrix>
<translation>0 -0</translation>
</uv>
</tex_coord_generation>
<smooth>false</smooth>
</texture>
<texture>
<path>C:\Users\Zom-B\AppData\Local\Temp\indigo_temp_dir\indigo_temp_dir_1357756186\PACKED_2_indigo_logo.png</path>
<a>-0</a>
<b>1</b>
<c>-0</c>
<uv_set_index>0</uv_set_index>
<exponent>2.2</exponent>
<tex_coord_generation>
<uv>
<matrix>1 0 0 1</matrix>
<translation>0 -0</translation>
</uv>
</tex_coord_generation>
<smooth>false</smooth>
</texture>
<texture>
<path>C:\Users\Zom-B\AppData\Local\Temp\indigo_temp_dir\indigo_temp_dir_1357756186\PACKED_3_UV_mapper.jpg</path>
<a>-0</a>
<b>1</b>
<c>-0</c>
<uv_set_index>0</uv_set_index>
<exponent>2.2</exponent>
<tex_coord_generation>
<uv>
<matrix>1 0 0 1</matrix>
<translation>0 -0</translation>
</uv>
</tex_coord_generation>
<smooth>false</smooth>
</texture>
<albedo>
<shader>
<shader><![CDATA[
def rotate(real r, vec2 st) vec2:
let
s = x(st)
t = y(st)
in
if(r < 0.5,
if(r < 0.25,
vec2(s, t),
vec2(t, -s)
),
if(r < 0.75,
vec2(-s, -t),
vec2(-t, s)
)
)
def eval(vec3 pos) vec3 :
let
uv = getTexCoords(0)
st = rotate(gridNoise(uv), uv)
NUM_TEXTURES = 3
tex_index = floorToInt(gridNoise(vec2(x(uv) + 45655.0, y(uv) + 3257.0)) * real(NUM_TEXTURES))
in
sample2DTextureVec3(tex_index, st)
]]></shader>
</shader>
</albedo>
<random_triangle_colours>false</random_triangle_colours>
<layer>0</layer>
</diffuse>
</material>
</scenedata>
polygonmanufaktur.de
Re: random rotation texture tiles
Not currently.Zom-B wrote: Ono, is there a Exporter friendly way of defining the textures directly in the Shader?
Re: random rotation texture tiles
Setting some Variables that define maps and use them later on in the Shader would be useful.
Keeping stuff in the Shader would raise compatibility to Exporters, and ISL coding easier for n00bs like me ^^
Keeping stuff in the Shader would raise compatibility to Exporters, and ISL coding easier for n00bs like me ^^
polygonmanufaktur.de
Re: random rotation texture tiles
I uploaded a material using this random texture selection approach:
http://www.indigorenderer.com/materials/materials/1182
You can replace the textures used with your own textures to make it work for ceramic tiles etc..
http://www.indigorenderer.com/materials/materials/1182
You can replace the textures used with your own textures to make it work for ceramic tiles etc..
Who is online
Users browsing this forum: No registered users and 28 guests