Warp or Distort OSL C4D Noises

Forums: Warp or Distort OSL C4D Noises
Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderator: aoktar

Warp or Distort OSL C4D Noises

Postby astrofalcon » Sun Feb 25, 2024 12:01 am

astrofalcon Sun Feb 25, 2024 12:01 am
Is it possible to distort or "warp" the 3D space of the OSL based C4D Noises? Like plug one noise into the Global Scale parameter of another for example?

The functionality I'm missing was called the "Distorter" that you could layer up with classic C4D.

I need this to work in 3D and not the 2D method "Distort mesh UV"

Any help to achieve this in Octane would be much appreciated!!
astrofalcon
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Wed Apr 26, 2017 4:32 am

Re: Warp or Distort OSL C4D Noises

Postby astrofalcon » Wed Feb 28, 2024 4:52 am

astrofalcon Wed Feb 28, 2024 4:52 am
Surly there is someone who knows how to do this in Octane. This functionality has been in Arnold for a LONG time and Redshift more recently.
astrofalcon
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Wed Apr 26, 2017 4:32 am

Re: Warp or Distort OSL C4D Noises

Postby jobigoud » Wed Feb 28, 2024 10:04 am

jobigoud Wed Feb 28, 2024 10:04 am
I have a set of OSL nodes I've been working on for this. Distorting UVW space in 3D based on other textures. Would you be able to work with OSL nodes, can you test this?

These are OSL-based projections nodes for now, so you have to create an OSL projection and point it to the script.
The design is different than for distorted mesh UV, based on user feedback.

As these have more controls over the transformations I split them into 3 separate nodes for rotation, scaling and translation.

Each node supports three types of operation: uniform transform, map-based transform and map-based jitter. Jitter randomizes within a range with the jitter value driven by a map (expected in [0..1] in this case).

They also all have a projection input, so you can daisy-chain them.

Unlike distort UV, each axis gets its own map, and the maps are expected to be grayscale (typically either a single number or a noise). This way we don't have to build a color map with other nodes or use channel split/merge just to translate on one axis for example.

For scale there are also controls that work on all 3 axes at once.

It would be great if you or anyone could test this and see if it behaves as you expect or ways to improve it.

Here are the three nodes:
proj-rotate.osl
(2.6 KiB) Downloaded 21 times

proj-scale.osl
(2.59 KiB) Downloaded 22 times

proj-translate.osl
(1.96 KiB) Downloaded 21 times


Here is a test ORBX with various examples.
demo-projection-operators.zip
(415.42 KiB) Downloaded 19 times


Example of simple distortion:
proj-demo.jpg


Example of the node interface:
projection-node-interface.png
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: Warp or Distort OSL C4D Noises

Postby astrofalcon » Thu Feb 29, 2024 3:36 pm

astrofalcon Thu Feb 29, 2024 3:36 pm
Awesome jobigoud! These look like a great set of OSL nodes that should do what I'm looking for!! I'll report back once I've had some time to test and play with them! Thank you!
astrofalcon
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Wed Apr 26, 2017 4:32 am

Re: Warp or Distort OSL C4D Noises

Postby astrofalcon » Sat Mar 02, 2024 6:25 pm

astrofalcon Sat Mar 02, 2024 6:25 pm
Hey there jobigoud, so these OSL shaders seem to do the trick but not with C4D noises as the projection input on the C4D noises seems to be broken. I can only get these to work correctly with other OSL noises that have a working projection input.

Can someone confirm this? Do the transform and projection inputs on the OSL version of C4D noises not do anything? Why are they there if they don't work...

Thanks!
astrofalcon
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Wed Apr 26, 2017 4:32 am

Re: Warp or Distort OSL C4D Noises

Postby jobigoud » Sat Mar 02, 2024 8:31 pm

jobigoud Sat Mar 02, 2024 8:31 pm
If I’m not mistaken in C4D there are two versions of these noises, the original ones and a re-implementation specific to Octane, and there is an option somewhere to tell it to use one or the other, maybe that’s it?
It works in standalone on the "Cinema 4D noise" texture node we have there so it should work I think, unless these are another implementation.
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: Warp or Distort OSL C4D Noises

Postby astrofalcon » Sun Mar 03, 2024 2:46 am

astrofalcon Sun Mar 03, 2024 2:46 am
This is using the OSL based C4D noise (only version I believe that is working in 3D world space) but the projection port does nothing.

Not Working.jpg


In this shot I'm using an OSL based flow noise that is being distorted or "translated" by one of your wonderful OSL shaders and this is working great! I just don't know why the OSL C4D noise ports do not work.
Attachments
Working.jpg
astrofalcon
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Wed Apr 26, 2017 4:32 am

Re: Warp or Distort OSL C4D Noises

Postby jobigoud » Sun Mar 03, 2024 9:57 am

jobigoud Sun Mar 03, 2024 9:57 am
Most likely this implementation of the C4D noise hard coded the use of the `P` global for the input point instead of using the variable from the projection pin.
If you plug one of the built-in projection like XYZ to UVW or Box and change its transform it's not working either?
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: Warp or Distort OSL C4D Noises

Postby jobigoud » Mon Mar 04, 2024 11:39 am

jobigoud Mon Mar 04, 2024 11:39 am
Use the "Noise4D" one instead if possible:
Noise4D.png
Noise4D.png (19.35 KiB) Viewed 386 times
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: Warp or Distort OSL C4D Noises

Postby astrofalcon » Tue Mar 05, 2024 6:02 am

astrofalcon Tue Mar 05, 2024 6:02 am
As far as I know that is the "old" c4d noise implementation and does not work as a true 3D/4D noise if I'm not mistaken. I'm more familiar with Arnold and Redshift.
astrofalcon
Licensed Customer
Licensed Customer
 
Posts: 13
Joined: Wed Apr 26, 2017 4:32 am
Next

Return to Maxon Cinema 4D


Who is online

Users browsing this forum: No registered users and 28 guests

Sat Apr 27, 2024 3:12 pm [ UTC ]