Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(181)

Issue 5447073: Hue Saturation Value Node for Cycles (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by dfelinto
Modified:
12 years, 5 months ago
Reviewers:
brechtvl, bf-codereview
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

conversion of HSV Node to Cycles OSL: ---- I moved the rgb_to_hsv and hsv_to_rgb out of the node_mix.osl to the node_color.h (where we have srgb/linear space functios). Also, I had to change the variables name (in relation to the nodes.cpp). Because there are two variables named Color. Since I can't build OSL, I couldn't really test if the arguments will be parsed by order or by the name. SVM: ---- I moved the rgb... functions to the new svm_hsv.h. I think that it makes more sense to be there than to be in the svm_mix.h It can be moved to a new svm_color.h if you think it's better. Other: ----- I'm using fmod instead of the manual operation we have in the blender render node: hsv[0] += hue - 0.5; if hsv[0] < 0: hsv[0] -= 1.0; if hsv[0] > 1: hsv[0] += 1.0 I don't know if fmod is faster or not though. Also, Hue, Saturation and Value can be calculated separated. So in theory this node could be broke in 3 nodes that could run in parallel. I don't know if the code would take advantage of this though (or if the overhead would make it worse). And I'm not sure if we actually get multithreading when having multiple nodes (I think not, but that may be another way).

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+309 lines, -150 lines) Patch
intern/cycles/app/cycles_xml.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
intern/cycles/blender/blender_shader.cpp View 2 chunks +4 lines, -1 line 0 comments Download
intern/cycles/kernel/CMakeLists.txt View 1 chunk +1 line, -0 lines 0 comments Download
intern/cycles/kernel/osl/nodes/CMakeLists.txt View 1 chunk +1 line, -0 lines 0 comments Download
intern/cycles/kernel/osl/nodes/node_color.h View 1 chunk +75 lines, -0 lines 0 comments Download
intern/cycles/kernel/osl/nodes/node_hsv.osl View 1 chunk +42 lines, -0 lines 0 comments Download
intern/cycles/kernel/osl/nodes/node_mix.osl View 1 chunk +1 line, -73 lines 0 comments Download
intern/cycles/kernel/svm/svm.h View 2 chunks +4 lines, -0 lines 0 comments Download
intern/cycles/kernel/svm/svm_hsv.h View 1 chunk +131 lines, -0 lines 0 comments Download
intern/cycles/kernel/svm/svm_mix.h View 1 chunk +2 lines, -74 lines 0 comments Download
intern/cycles/kernel/svm/svm_types.h View 1 chunk +2 lines, -1 line 0 comments Download
intern/cycles/render/nodes.h View 1 chunk +5 lines, -0 lines 0 comments Download
intern/cycles/render/nodes.cpp View 1 chunk +37 lines, -0 lines 0 comments Download
source/blender/nodes/shader/nodes/node_shader_hueSatVal.c View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2
dfelinto
12 years, 5 months ago (2011-12-02 10:19:53 UTC) #1
brechtvl
12 years, 5 months ago (2011-12-02 14:13:19 UTC) #2
LGTM. fmod is more correct if you get values further away from 0/1. Regarding
multithreading, that doesn't matter here, all threads render different pixels,
the node graph is evaluated entirely by one thread always.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b