GPUOpen-LibrariesAndSDKs / RadeonProRenderBlenderAddon

This hardware-agnostic rendering plug-in for Blender uses accurate ray-tracing technology to produce images and animations of your scenes, and provides real-time interactive rendering and continuous adjustment of effects.
https://gpuopen.com/radeon-prorender-suite/
Apache License 2.0
480 stars 56 forks source link

Correct improper range in ShaderNodeHueSaturation #612

Closed jombo23 closed 1 year ago

jombo23 commented 1 year ago

PURPOSE

The Hue value being used is mapped 0-1 in blender, and 0-2pi in RPR, and is also reversed. This small edit fixes that to align with the blender norms

EFFECT OF CHANGE

Anything that uses the HSV shader node should generate matching colors in ProRender and eevee/cycles. Hopefully this is a quick and painless correction :)

TECHNICAL STEPS

Since RPR is calling sin/cos directly on the hue value, its expected that the inputs are 0-2pi. Blenders norm is 0-1, and are also inverted compared to RPR. Therefore, the incoming hue value is now multiplied by negative tau in order to achieve matching color generation with the rest of the rendering engines.

NOTES FOR REVIEWERS

Sample blend file for comparison prorenderScaleDemo.zip

Renderer outputs for comparison:

Eevee EEVEE Hue

Cycles Cycles Hue

ProRender prorender hue

ProRender After this patch

prorender patched hue

Please note that the colors do not seem to be identical, but as far as my testing goes, they are. Prorender just represents colors differently (unless theres some other math bug, but i do not believe that is the case).

VascoPi commented 1 year ago

It's ready for tests. @jombo23 could you please update with latest master?

jombo23 commented 1 year ago

@VascoPi Done.