Page 1 of 1

BG Random UV Projection node

PostPosted: Sun Oct 21, 2018 9:57 pm
by bepeg4d
Hi all,
here is an OSL Projection node to randomise position, rotation and scale of the uvs of scattered objects. It uses the Random Color Texture node to obtain the random values, but you can use any other texture node:

https://vimeo.com/296310449
Hint #1:
Connect the same Random Color Texture node used to drive the OSL Projection, firstly into a Gradient node to batter control the range, and then in the Power pin of the ImageTexture node, to randomly change also the aspect of the texture over clones:

Capture_30.PNG

Here is the OSL script:
BGrandomUVproj_osl.zip
(931 Bytes) Downloaded 107 times

an .orbx example scene:
BGrandomUVproj_orbx.zip
(368.75 KiB) Downloaded 85 times

and a c4doctane example scene:
BGrandomUVproj_c4d.zip
(465 KiB) Downloaded 97 times


Hint #2:
If you use the following OSL Texture node RandomInstanceColor.osl, provided by Milanm here:
Code: Select all
#include <octane-oslintrin.h>
shader RandomInstanceColor(
      int Seed=0,
      output color c = 0)
{   
      c = noise("cell",_getinstanceid(),Seed);
}

Instead of a Random Color node, the BGRandomUVProjection OSL node works also with non instanced objects too.
In Standalone you need to have a Scatter object connected to each different object:
388C3327-FE25-4BD8-B10A-D7BE6E3E9414.jpeg

While in c4doctane you need to add an Octane Object tag, with differet Instance ID numbers, for example selecting all the tags, and entering num+1:
7658C759-32E5-405E-97D7-7BD7E97C24A0.jpeg

Here is a a Standalone .orbx, and .c4d example scene with both osl scripts working together:
randomuvsonobjects.zip
(2.32 MiB) Downloaded 59 times


Happy GPU Rendering,
ciao Beppe

Re: BG Random UV Projection node

PostPosted: Thu Oct 25, 2018 4:04 pm
by FxDesign
That's fantastic, thank you

Re: BG Random UV Projection node

PostPosted: Wed Dec 05, 2018 3:45 am
by funk
Thanks Beppe. Very handy!

Re: BG Random UV Projection node

PostPosted: Wed Dec 05, 2018 8:48 am
by J.C
Wow!. Awesome script. Thanks for sharing Beppe!

Re: BG Random UV Projection node

PostPosted: Sun Mar 03, 2019 9:47 am
by bepeg4d
Hi,
I have updated the first post with the great hint provided by Milanm here, of using the OSL Texture node RandomInstanceColor.osl, instead of the Octane Random Color node.
Happy GPU Rendering,
ciao Beppe

Re: BG Random UV Projection node

PostPosted: Sun Mar 03, 2019 5:30 pm
by pxlntwrk
thanks bepeg,
that's really cool and useful...