This includes much improved GPU rendering performance, viewport interactivity, new shadow catcher, revamped sampling settings, subsurface scattering anisotropy, new GPU volume sampling, improved PMJ sampling pattern, and more. Some features have also been removed or changed, breaking backwards compatibility. Including the removal of the OpenCL backend, for which alternatives are under development. Release notes and code docs: https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles https://wiki.blender.org/wiki/Source/Render/Cycles Credits: * Sergey Sharybin * Brecht Van Lommel * Patrick Mours (OptiX backend) * Christophe Hery (subsurface scattering anisotropy) * William Leeson (PMJ sampling pattern) * Alaska (various fixes and tweaks) * Thomas Dinges (various fixes) For the full commit history, see the cycles-x branch. This squashes together all the changes since intermediate changes would often fail building or tests. Ref T87839, T87837, T87836 Fixes T90734, T89353, T80267, T80267, T77185, T69800
108 lines
3.4 KiB
C
108 lines
3.4 KiB
C
/*
|
|
* Copyright 2011-2013 Blender Foundation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
/* Vector Transform */
|
|
|
|
ccl_device_noinline void svm_node_vector_transform(const KernelGlobals *kg,
|
|
ShaderData *sd,
|
|
float *stack,
|
|
uint4 node)
|
|
{
|
|
uint itype, ifrom, ito;
|
|
uint vector_in, vector_out;
|
|
|
|
svm_unpack_node_uchar3(node.y, &itype, &ifrom, &ito);
|
|
svm_unpack_node_uchar2(node.z, &vector_in, &vector_out);
|
|
|
|
float3 in = stack_load_float3(stack, vector_in);
|
|
|
|
NodeVectorTransformType type = (NodeVectorTransformType)itype;
|
|
NodeVectorTransformConvertSpace from = (NodeVectorTransformConvertSpace)ifrom;
|
|
NodeVectorTransformConvertSpace to = (NodeVectorTransformConvertSpace)ito;
|
|
|
|
Transform tfm;
|
|
bool is_object = (sd->object != OBJECT_NONE);
|
|
bool is_direction = (type == NODE_VECTOR_TRANSFORM_TYPE_VECTOR ||
|
|
type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL);
|
|
|
|
/* From world */
|
|
if (from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD) {
|
|
if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) {
|
|
tfm = kernel_data.cam.worldtocamera;
|
|
if (is_direction)
|
|
in = transform_direction(&tfm, in);
|
|
else
|
|
in = transform_point(&tfm, in);
|
|
}
|
|
else if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT && is_object) {
|
|
if (is_direction)
|
|
object_inverse_dir_transform(kg, sd, &in);
|
|
else
|
|
object_inverse_position_transform(kg, sd, &in);
|
|
}
|
|
}
|
|
|
|
/* From camera */
|
|
else if (from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) {
|
|
if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD ||
|
|
to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) {
|
|
tfm = kernel_data.cam.cameratoworld;
|
|
if (is_direction)
|
|
in = transform_direction(&tfm, in);
|
|
else
|
|
in = transform_point(&tfm, in);
|
|
}
|
|
if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT && is_object) {
|
|
if (is_direction)
|
|
object_inverse_dir_transform(kg, sd, &in);
|
|
else
|
|
object_inverse_position_transform(kg, sd, &in);
|
|
}
|
|
}
|
|
|
|
/* From object */
|
|
else if (from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) {
|
|
if ((to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD ||
|
|
to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) &&
|
|
is_object) {
|
|
if (is_direction)
|
|
object_dir_transform(kg, sd, &in);
|
|
else
|
|
object_position_transform(kg, sd, &in);
|
|
}
|
|
if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) {
|
|
tfm = kernel_data.cam.worldtocamera;
|
|
if (is_direction)
|
|
in = transform_direction(&tfm, in);
|
|
else
|
|
in = transform_point(&tfm, in);
|
|
}
|
|
}
|
|
|
|
/* Normalize Normal */
|
|
if (type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL)
|
|
in = normalize(in);
|
|
|
|
/* Output */
|
|
if (stack_valid(vector_out)) {
|
|
stack_store_float3(stack, vector_out, in);
|
|
}
|
|
}
|
|
|
|
CCL_NAMESPACE_END
|