COPS - how to convert SLOPE cop output to RGB ?

   589   3   1
User Avatar
Member
84 posts
Joined: 9月 2008
オフライン
Hello I've been playing with the flow options converting noise patterns to velocity via the Slope sop.
I really like the colours as displayed in the SLOPE SOP and would like to export them as RGB.
The problem I have when doing a UV to RGB is that colours change.
Does anyone know how to conserve the colours?
I thought this was simple but I've ended up doing a deep dive on layer properties and see from inside the sope sop
that its type is 'vector' as a opposed to 'color'. And I'm guessing that its doing something to display it in RGB for us, the U and V set to R and G with some scaling but how is the B ?
Any thoughts much appreciated thanks

Attachments:
SLOPE.png (2.7 MB)
UV_RGB.png (1.8 MB)

User Avatar
Member
30 posts
Joined: 11月 2013
オフライン
I think it's doing some 2D vector-to-HSV mapping but I couldn't find any built-in OpenCL functions to do that. I found an algorithm that seems to work, it's not exactly matching the original but it's close, see attached.
Edited by Techie - 2025年9月12日 18:51:59

Attachments:
slope_direction_to_rgb.hip (90.5 KB)

Houdini FX 21 | http://techie.se [techie.se]
User Avatar
スタッフ
6741 posts
Joined: 7月 2005
オンライン
We have some default "visualizers" to help view data types that otherwise would not be visible. Having negative directions all go black isn't very helpful for telling how things will swirl.

Unfortunately, we don't have a Bake Visualizer node, so it is hard to get a rendered output of what you see for things like SDFs and Vector2s.

The code is pretty simple - it projects onto a hexagone in RGB space and then scales by the length of the vector.

In the attached I've copied the code from our visualizers verbatim so should get the same result.

Attachments:
bake2d.hip (98.3 KB)

User Avatar
Member
30 posts
Joined: 11月 2013
オフライン
Nice, thanks Jeff!
Houdini FX 21 | http://techie.se [techie.se]
  • Quick Links