|
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).
|
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
|
Total messages: 2
|