How to convert CinemaRGB to Octane Float colour with Xpresso

Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderators: ChrisHekman, aoktar

Post Reply
User avatar
sphericall
Licensed Customer
Posts: 60
Joined: Sun Jan 06, 2013 2:58 pm
Location: Bytom
Contact:

I have an material which is composed of 3 mix materials one Glossy and thw Diffuse materials.
All of them are using the same three source colours.
I made and Xpress setup with UserData to easy control source colours in one place.
But I found the problem, how to convert Cinema RGB (1-255 range) to Octane float colour (0-1 range)

Image

I used Range Mapper node like this:
Image

Image

So the Cinema colour is:
RGB 121/141/163 and in Xpresso it gives value accordingly 47.654% 58.433% 64.118%
And for use in octane it should be 0.193 0.301 0.361

Please, help how to convert this weird numbers ;) I know there shoud be Gamma applied somehow...
I'd like to control all colours in one place!!
Win 7 64 bit | 2 x GeForce GTX 660 | Intel Core i7-930 CPU 2,8 GHz | 8GB | Cinema 4d r15 Visualize (no Mograph, no Hair)| OCTANE benchmark scene 2,06 Ms/sec
User avatar
bepeg4d
Octane Guru
Posts: 10361
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi, what about changing the RGB range in the c4d preferences to 0-100%?
in theory you need only to add a math-divide node for getting the correct result
ciao beppe
Attachments
Capture-r15-103-02.JPG
User avatar
sphericall
Licensed Customer
Posts: 60
Joined: Sun Jan 06, 2013 2:58 pm
Location: Bytom
Contact:

Anyway it doesn't help. Cinema colours must be Gamma correctet to get the Octane values.
Look at this cinema values are 1-100% (lower window) and it is still not the same
Image
Win 7 64 bit | 2 x GeForce GTX 660 | Intel Core i7-930 CPU 2,8 GHz | 8GB | Cinema 4d r15 Visualize (no Mograph, no Hair)| OCTANE benchmark scene 2,06 Ms/sec
User avatar
aoktar
Octane Plugin Developer
Posts: 16066
Joined: Tue Mar 23, 2010 8:28 pm
Location: Türkiye
Contact:

plugin converts this colors to linear (SRGB -> LINEAR)

Vector clr = TransformColor(Vector(r,g,b), COLORSPACETRANSFORMATION_SRGB_TO_LINEAR);
Octane For Cinema 4D developer / 3d generalist

3930k / 16gb / 780ti + 1070/1080 / psu 1600w / numerous hw
User avatar
bepeg4d
Octane Guru
Posts: 10361
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

are you sure that you need to convert the rgb value?
maybe i have misunderstand but, here is a simple scene without conversion and it seems to work, change the color in the c4d standard material and the three octane materials takes the same color:
color-reference.rar
(121.8 KiB) Downloaded 291 times
ciao beppe
User avatar
sphericall
Licensed Customer
Posts: 60
Joined: Sun Jan 06, 2013 2:58 pm
Location: Bytom
Contact:

I'm some kind of happy now :D
Suppose it is C++, now need to find the way use it in Xpresso by COFFEE or Python script.
Win 7 64 bit | 2 x GeForce GTX 660 | Intel Core i7-930 CPU 2,8 GHz | 8GB | Cinema 4d r15 Visualize (no Mograph, no Hair)| OCTANE benchmark scene 2,06 Ms/sec
User avatar
sphericall
Licensed Customer
Posts: 60
Joined: Sun Jan 06, 2013 2:58 pm
Location: Bytom
Contact:

bepeg4d wrote:are you sure that you need to convert the rgb value?
maybe i have misunderstand but, here is a simple scene without conversion and it seems to work, change the color in the c4d standard material and the three octane materials takes the same color:
color-reference.rar
ciao beppe
Finally I did it the same way, but as I need to change 3 colors I made nice Setup with UserData and Xpresso, like this:

Image

And my goal was not to generate new Materials. Now one material definition looks like that.

Image

And my COLOR CONTROL Diffuse channel looks like that:

Image

It is not the best setup in terms of usability. But it works :)
Thanks.

Here is my setup. Look into the Xpresso tag.
color-control.zip
Win 7 64 bit | 2 x GeForce GTX 660 | Intel Core i7-930 CPU 2,8 GHz | 8GB | Cinema 4d r15 Visualize (no Mograph, no Hair)| OCTANE benchmark scene 2,06 Ms/sec
Post Reply

Return to “Maxon Cinema 4D”