Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_material.glsl
| Context not available. | |||||
| normal.z = 2.0 * ((color.b) - 0.5); | normal.z = 2.0 * ((color.b) - 0.5); | ||||
| } | } | ||||
| void color_to_normal_new_shading(vec3 color, out vec3 normal) | |||||
a.romanov: These glsl functions came from Сycles logic? Or it's just heuristics? | |||||
Not Done Inline ActionsThis function exists because in Cycles, the y component of the normal is not flipped like in BI. cheleb: This function exists because in Cycles, the y component of the normal is not flipped like in BI. | |||||
| { | |||||
| normal.x = 2.0 * ((color.r) - 0.5); | |||||
| normal.y = 2.0 * ((color.g) - 0.5); | |||||
| normal.z = 2.0 * ((color.b) - 0.5); | |||||
| } | |||||
| void color_to_blender_normal_new_shading(vec3 color, out vec3 normal) | |||||
Not Done Inline Actionscheleb: This is based on the OSL version of the normal_map_node [[ https://developer.blender. | |||||
| { | |||||
| normal.x = 2.0 * ((color.r) - 0.5); | |||||
| normal.y = -2.0 * ((color.g) - 0.5); | |||||
| normal.z = -2.0 * ((color.b) - 0.5); | |||||
| } | |||||
| #define M_PI 3.14159265358979323846 | #define M_PI 3.14159265358979323846 | ||||
| #define M_1_PI 0.31830988618379069 | #define M_1_PI 0.31830988618379069 | ||||
| Context not available. | |||||
These glsl functions came from Сycles logic? Or it's just heuristics?