UVW Randomization

UVW Randomization

mckenzie2VER2
Advocate Advocate
1,908 Views
10 Replies
Message 1 of 11

UVW Randomization

mckenzie2VER2
Advocate
Advocate

Is there a native way of doing this other than relying on OSL? Any plans for a native node like that in Vray?

0 Likes
1,909 Views
10 Replies
Replies (10)
Message 2 of 11

peter_horvath
Autodesk
Autodesk

There's no dedicated node to randomize UVs. You can put a shader graph together with uv_transform, utility, etc. shaders, or write/look for an OSL shader as you said, which is probably simpler and more efficient.


// Peter Horvath
// C4DtoA developer
0 Likes
Message 3 of 11

mckenzie2VER2
Advocate
Advocate

With that in mind how would accomplish randomization per mesh, per face or stochastic tiling? You can also specify how many degrees of rotation and how many steps in that rotation should be randomized. How would this be accomplished?

0 Likes
Message 4 of 11

peter_horvath
Autodesk
Autodesk

I was thinking something like:

  • Read object id / face id in a utility shader.
  • Add a random shader to generate random color from the ids based on a seed value.
  • Add a range shader to map to a desired range.
  • Connect to the right input of uv_transform.

Don't know if it works though, or covers all your needs, but could be a starting point.


// Peter Horvath
// C4DtoA developer
0 Likes
Message 5 of 11

mckenzie2VER2
Advocate
Advocate

I'd already tried something like that but it didn't work. I was trying to use a range node so I could remap the values to what degrees I wanted, say max rotation of 180 but I get a node error when plugging into the U or V of the image node. If you connect the value node to a tri planar uv offset you don't get the error but then you loose the ability to just offset one of the UV's.

0 Likes
Message 6 of 11

peter_horvath
Autodesk
Autodesk

The UV parameters on the image node are not linkable. Try using a uv_transform shader, where you can link to the inputs.

To control components of a vector separately, like you mentioned the UV offset of triplanar, you can use a float_to_rgb shader.


// Peter Horvath
// C4DtoA developer
0 Likes
Message 7 of 11

mckenzie2VER2
Advocate
Advocate

Like this?

 

 

0 Likes
Message 8 of 11

peter_horvath
Autodesk
Autodesk

Yes, that's what I was thinking. Does it work ok?


// Peter Horvath
// C4DtoA developer
0 Likes
Message 9 of 11

mckenzie2VER2
Advocate
Advocate

I think so, but haven't played with it much, to busy watching the World Cup!

0 Likes
Message 10 of 11

mckenzie2VER2
Advocate
Advocate

Screenshot 2022-11-25 at 9.23.41 AM.png

Screenshot 2022-11-25 at 9.23.46 AM.png

0 Likes
Message 11 of 11

mckenzie2VER2
Advocate
Advocate

BTW, when I first tried this, it hard crashed my Mac.

{\rtf1\ansi\ansicpg1252\cocoartf2706
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\fs24 \cf0 \uc0\u711 panic(cpu 4 caller 0xffffff80232d3941): userspace watchdog timeout: no successful checkins from WindowServer in 120 seconds\
WindowServer has not exited since first loaded\
service: logd, total successful checkins in 256457 seconds: 17769, last successful checkin: 0 seconds ago\
service: WindowServer, total successful checkins in 256423 seconds: 17753, last successful checkin: 120 seconds ago\
service: remoted, total successful checkins in 256457 seconds: 17767, last successful checkin: 0 seconds ago\
service: opendirectoryd, total successful checkins in 256457 seconds: 17768, last successful checkin: 0 seconds ago\
service: configd, total successful checkins in 256457 seconds: 17768, last successful checkin: 0 seconds ago\
\
Panicked task 0xffffff95528759d8: 3 threads: pid 130: watchdogd\
Backtrace (CPU 4), panicked thread: 0xffffff955545f598, Frame : Return Address\
0xfffffff842377590 : 0xffffff801ffedf9d \
0xfffffff8423775e0 : 0xffffff802015b786 \
0xfffffff842377620 : 0xffffff802014aa10 \
0xfffffff842377670 : 0xffffff801ff88951 \
0xfffffff842377690 : 0xffffff801ffee27d \
0xfffffff842377780 : 0xffffff801ffed929 \
0xfffffff8423777e0 : 0xffffff80207e0f93 \
0xfffffff8423778d0 : 0xffffff80232d3941 \
0xfffffff8423778e0 : 0xffffff80232d35e0 \
0xfffffff842377900 : 0xffffff80232d26cd \
0xfffffff842377a30 : 0xffffff80207544ca \
0xfffffff842377b90 : 0xffffff8020102319 \
0xfffffff842377ca0 : 0xffffff801ffc5999 \
0xfffffff842377d50 : 0xffffff801ffde892 \
0xfffffff842377dc0 : 0xffffff801ffdef9a \
0xfffffff842377ef0 : 0xffffff802012d02a \
0xfffffff842377fa0 : 0xffffff801ff88db6 \
      Kernel Extensions in backtrace:\
         com.apple.driver.watchdog(1.0)[A71DE745-044D-37DB-B730-8F8FFB66B24A]@0xffffff80232d1000->0xffffff80232d3fff\
\
Process name corresponding to current thread (0xffffff955545f598): watchdogd\
\
Mac OS version:\
22A400\
\
Kernel version:\
Darwin Kernel Version 22.1.0: Sun Oct  9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64\
Kernel UUID: BF7C9676-EF23-3E8D-A2E2-25DAC63091B6\
roots installed: 0\
KernelCache slide: 0x000000001fc00000\
KernelCache base:  0xffffff801fe00000\
Kernel slide:      0x000000001fcdc000\
Kernel text base:  0xffffff801fedc000\
__HIB  text base: 0xffffff801fd00000\
System model name: MacPro7,1 (Mac-27AD2F918AE68F61)\
System shutdown begun: NO\
Hibernation exit count: 0\
\
System uptime in nanoseconds: 256457513499235\
Last Sleep:           absolute           base_tsc          base_nano\
  Uptime  : 0x0000e93f2afdff03\
  Sleep   : 0x000063df7841110a 0x00000001eb6e4198 0x000063cb0335ce54\
  Wake    : 0x000063dfd8ca63f4 0x00000001eb838534 0x000063dfcd48278f\
Compressor Info: 0% of compressed pages limit (OK) and 9% of segments limit (OK) with 1 swapfiles and OK swap space\
Zone info:\
  Zone map: 0xffffff808235d000 - 0xffffffa08235d000\
  . PGZ   : 0xffffff808235d000 - 0xffffff808e35e000\
  . VM    : 0xffffff808e35e000 - 0xffffff855935d000\
  . RO    : 0xffffff855935d000 - 0xffffff86f235d000\
  . GEN0  : 0xffffff86f235d000 - 0xffffff8bbd35d000\
  . GEN1  : 0xffffff8bbd35d000 - 0xffffff908835d000\
  . GEN2  : 0xffffff908835d000 - 0xffffff955335d000\
  . GEN3  : 0xffffff955335d000 - 0xffffff9a1e35d000\
  . DATA  : 0xffffff9a1e35d000 - 0xffffffa08235d000\
  Metadata: 0xffffffa0c6b6d000 - 0xffffffa0e6b6d000\
  Bitmaps : 0xffffffa0e6b6d000 - 0xffffffa106b6d000\
\
last started kext at xxx-xxxxxxxx: >!AHIDKeyboard	231 (addr 0xffffff8021410000, size 20480)\
last stopped kext at 1524015818596: >!AThunderboltEDMSink	5.0.3 (addr 0xffffff7fb5aee000, size 32768)\
loaded kexts:\
>!ATopCaseHIDEventDriver	6000.22\
>!AHIDALSService	1\
>!APlatformEnabler	2.7.0d0\
>X86PlatformShim	1.0.0\
>AGPM	131\
>!AUpstreamUserClient	3.6.9\
>!AMCCSControl	1.16\
@filesystems.autofs	3.0\
@kext.AMDRadeonX6000	4.0.9\
@kext.AMDRadeonServiceManager	4.0.9\
>!ABridgeAudio!C	300.10\
>!AGFXHDA	200.2\
>!AGraphicsDevicePolicy	7.1.16\
@AGDCPluginDisplayMetrics	7.1.16\
>pmtelemetry	1\
@filesystems.nfs	1\
|IOUserEthernet	1.0.1\
>usb.!UUserHCI	1\
>!AHV	1\
>!ADiskImages2	198.40.3\
>BridgeAudioCommunication	300.10\
>!A!ISlowAdaptiveClocking	4.0.0\
>!A!IPCHPMC	2.0.1\
>!AThunderboltIP	4.0.3\
>!AAVEBridge	6.1\
>!A!IMCEReporter	115\
@!AEthernetAquantiaAqtionFirmware	1.0.36\
>BCMWLANFirmware4387.Hashstore	1\
>BCMWLANFirmware4378.Hashstore	1\
>BCMWLANFirmware4377.Hashstore	1\
>BCMWLANFirmware4364.Hashstore	1\
>BCMWLANFirmware4355.Hashstore	1\
>!AFileSystemDriver	3.0.1\
@filesystems.tmpfs	1\
@filesystems.lifs	1\
@filesystems.hfs.kext	627.40.1\
@BootCache	40\
@!AFSCompression.!AFSCompressionTypeZlib	1.0.0\
@!AFSCompression.!AFSCompressionTypeDataless	1.0.0d1\
>!ABCMWLANBusInterfacePCIeMac	1\
@filesystems.apfs	2142.41.2\
@private.KextAudit	1.0\
>!AAHCIPort	370\
>!AACPIButtons	6.1\
>!ASMBIOS	2.1\
>!AACPIEC	6.1\
>!AAPIC	1.7\
$!AUserConsent	1\
@!ASystemPolicy	2.0.0\
@nke.applicationfirewall	403\
|IOKitRegistryCompatibility	1\
|EndpointSecurity	1\
@Dont_Steal_Mac_OS_X	7.0.0\
@kec.Compression	1\
@kec.!AEncryptedArchive	1\
>!AHIDKeyboard	231\
>!AMultitouchDriver	6400.44\
>!AInputDeviceSupport	6400.40\
>!AHS!BDriver	6000.22\
>IO!BHIDDriver	9.0.0\
>!ASMBus!C	1.0.18d1\
@kext.AMDRadeonX6800HWLibs	1.0\
|IOAccelerator!F2	475\
>usb.IOUSBHostHIDDevice	1.2\
@kext.AMDRadeonX6000HWServices	4.0.9\
>usb.cdc.acm	5.0.0\
>usb.serial	6.0.0\
>!UAudio	500.2\
>!AAudioClockLibs	200.5\
|IOAudio!F	400.3\
@vecLib.kext	1.2.0\
>!AGraphicsControl	7.1.16\
|IONDRVSupport	597\
>!A16X50Serial	3.2\
@kext.triggers	1.0\
>IOHIDPowerSource	1\
|IO!BSerialManager	9.0.0\
|IO!BPacketLogger	9.0.0\
|IO!BHost!CUSBTransport	9.0.0\
|IO!BHost!CUARTTransport	9.0.0\
|IO!BHost!CTransport	9.0.0\
>IO!BHost!CPCIeTransport	9.0.0\
|IOAVB!F	1100.24\
|CSR!BHost!CUSBTransport	9.0.0\
|Broadcom!BHost!CUSBTransport	9.0.0\
|Broadcom!B20703USBTransport	9.0.0\
>!ARSMChannel	1\
|IORSM!F	1\
>!AIPAppender	1.0\
>X86PlatformPlugin	1.0.0\
@!AGPUWrangler	7.1.16\
|IOSlowAdaptiveClocking!F	1.0.0\
@kext.AMDRadeonX6000Framebuffer	4.0.9\
@kext.AMDSupport	4.0.9\
@!AGraphicsDeviceControl	7.1.16\
|IOGraphics!F	597\
>IOPlatformPlugin!F	6.0.0d8\
@plugin.IOgPTPPlugin	1110.13\
>driverkit.serial	6.0.0\
>usb.cdc.ecm	5.0.0\
>usb.cdc.ncm	5.0.0\
>usb.!UHub	1.2\
>!AThunderboltDPOutAdapter	8.5.1\
>!AThunderboltPCIUpAdapter	4.1.1\
>usb.cdc	5.0.0\
>usb.networking	5.0.0\
>usb.!UHostCompositeDevice	1.2\
>!AThunderboltPCIDownAdapter	4.1.1\
>!AThunderboltDPInAdapter	8.5.1\
>!AThunderboltDPAdapter!F	8.5.1\
>!AHPM	3.4.4\
>!A!ILpssI2C!C	3.0.60\
>!A!ILpssDmac	3.0.60\
>!AThunderboltNHI	7.2.81\
|IOThunderbolt!F	9.3.3\
>usb.!UVHCIBCE	1.2\
>usb.!UVHCICommonBCE	1.0\
>usb.!UVHCI	1.2\
>usb.!UVHCICommon	1.0\
>!AEffaceableNOR	1.0\
|IONVMe!F	2.1.0\
|IOBufferCopy!C	1.1.0\
|IOBufferCopyEngine!F	1\
>!ABSDKextStarter	3\
|IOSurface	334.0.1\
@filesystems.hfs.encodings.kext	1\
>!ASyntheticGame!C	10.2.9\
>!ABCMWLANCoreMac	1.0.0\
|IO80211!F	1200.13.0\
>IOImageLoader	1.0.0\
>!AOLYHALMac	1\
|IOSerial!F	11\
>corecapture	1.0.4\
>!AEthernetAquantiaAqtion	1.0.64\
>usb.!UHostPacketFilter	1.0\
|IOUSB!F	900.4.2\
>!AXsanScheme	3\
|IOAHCIBlock!S	345\
>!A!ILpssI2C	3.0.60\
|IOAHCI!F	301\
>usb.!UXHCIPCI	1.2\
>usb.!UXHCI	1.2\
>!A!ILpssGspi	3.0.60\
>!AEFINVRAM	2.1\
>!ASMCRTC	1.0\
>!AEFIRuntime	2.1\
|IOSMBus!F	1.1\
|IOHID!F	2.0.0\
|IOTimeSync!F	1110.13\
|IOSkywalk!F	1.0\
>mDNSOffloadUserClient	1.0.1b8\
|IONetworking!F	3.4\
>DiskImages	493.0.0\
|IO!B!F	9.0.0\
|IOReport!F	47\
$quarantine	4\
$sandbox	300.0\
@kext.!AMatch	1.0.0d1\
>!ASSE	1.0\
>!AKeyStore	2\
>!UTDM	547\
|IOUSBMass!SDriver	232\
|IOSCSIBlockCommandsDevice	476\
|IO!S!F	2.1\
|IOSCSIArchitectureModel!F	476\
>!AMobileFileIntegrity	1.0.5\
$!AImage4	5.0.0\
@kext.CoreTrust	1\
>!AFDEKeyStore	28.30\
>!AEffaceable!S	1.0\
>!ACredentialManager	1.0\
|CoreAnalytics!F	1\
>KernelRelayHost	1\
|IOUSBHost!F	1.2\
>!UHostMergeProperties	1.2\
>usb.!UCommon	1.0\
>!ABusPower!C	1.0\
>!ASEPManager	1.0.1\
>IOSlaveProcessor	1\
>!AACPIPlatform	6.1\
>!ASMC	3.1.9\
|IOPCI!F	2.9\
|IOACPI!F	1.4\
>watchdog	1\
@kec.pthread	1\
@kec.Libm	1\
@kec.corecrypto	12.0\
}
0 Likes