BG Random UV Projection node

Forums: BG Random UV Projection node
Forum for OctaneRender Lua scripting examples, discussion and support.

BG Random UV Projection node

Postby bepeg4d » Sun Oct 21, 2018 9:57 pm

bepeg4d Sun Oct 21, 2018 9:57 pm
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 906 times

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

and a c4doctane example scene:
BGrandomUVproj_c4d.zip
(465 KiB) Downloaded 841 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 765 times


Happy GPU Rendering,
ciao Beppe
Last edited by bepeg4d on Sun Mar 03, 2019 9:53 am, edited 2 times in total.
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: BG Random UV Projection node

Postby FxDesign » Thu Oct 25, 2018 4:04 pm

FxDesign Thu Oct 25, 2018 4:04 pm
That's fantastic, thank you
FxDesign
Licensed Customer
Licensed Customer
 
Posts: 102
Joined: Wed Apr 24, 2013 10:47 am

Re: BG Random UV Projection node

Postby funk » Wed Dec 05, 2018 3:45 am

funk Wed Dec 05, 2018 3:45 am
Thanks Beppe. Very handy!
Win10 Pro/ Ryzen 5950X / 128GB / RTX 4090 / MODO
"I am the resurrection, and the life: he that believeth in me, though he were dead, yet shall he live" - Jesus Christ
User avatar
funk
Licensed Customer
Licensed Customer
 
Posts: 1204
Joined: Mon Feb 07, 2011 1:24 pm
Location: Australia

Re: BG Random UV Projection node

Postby J.C » Wed Dec 05, 2018 8:48 am

J.C Wed Dec 05, 2018 8:48 am
Wow!. Awesome script. Thanks for sharing Beppe!
CPU – i9 13900KF, 128GB RAM, GPU – RTX 4090
System – Windows 11
My Behance portfolio, Blender plugin FB support group
J.C
Licensed Customer
Licensed Customer
 
Posts: 1712
Joined: Thu May 13, 2010 6:35 pm
Location: Wrocław

Re: BG Random UV Projection node

Postby bepeg4d » Sun Mar 03, 2019 9:47 am

bepeg4d Sun Mar 03, 2019 9:47 am
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
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9940
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: BG Random UV Projection node

Postby pxlntwrk » Sun Mar 03, 2019 5:30 pm

pxlntwrk Sun Mar 03, 2019 5:30 pm
thanks bepeg,
that's really cool and useful...
:::::::::::::::::
pxlntwrk.net
User avatar
pxlntwrk
Licensed Customer
Licensed Customer
 
Posts: 436
Joined: Sat Mar 23, 2013 2:21 pm
Location: France

Re: BG Random UV Projection node

Postby neilmanisharma » Fri Feb 07, 2020 10:25 am

neilmanisharma Fri Feb 07, 2020 10:25 am
Can you tell me how it will work in blender? As i tried using OSL texture but it is giving error.
neilmanisharma
 
Posts: 1
Joined: Sat Aug 31, 2019 8:33 am

Re: BG Random UV Projection node

Postby roy_orengo » Sat Apr 04, 2020 9:15 am

roy_orengo Sat Apr 04, 2020 9:15 am
Hi Beppe,

You wrote:
"Instead of a Random Color node, the BGRandomUVProjection OSL node works also with non instanced objects too".
So I could use It without Blocks (I'm using Rhinoceros as modeller)? On different solids?

Thanks,
ciao,
Roy
roy_orengo
Licensed Customer
Licensed Customer
 
Posts: 65
Joined: Tue Nov 06, 2018 9:06 am

Re: BG Random UV Projection node

Postby mortom_ckm » Sat Dec 12, 2020 9:07 pm

mortom_ckm Sat Dec 12, 2020 9:07 pm
Hi I'm green in this stuff - In Octane I mean :)
There is a way to do this in Octane for Blender? I suppose connect node "OSL Projection" with script to the shader it's not do the trick?
Image
mortom_ckm
 
Posts: 3
Joined: Fri Dec 11, 2020 2:37 pm

Re: BG Random UV Projection node

Postby mortom_ckm » Sun Dec 13, 2020 11:41 am

mortom_ckm Sun Dec 13, 2020 11:41 am
Hi
There is a way to do this in Blender?
mortom_ckm
 
Posts: 3
Joined: Fri Dec 11, 2020 2:37 pm
Next

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 9 guests

Thu Mar 28, 2024 8:52 am [ UTC ]