Cycles: change Ambient Occlusion shader to output colors.

This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.

Original patch by Lukas with further changes by Brecht.

Differential Revision: https://developer.blender.org/D3479
This commit is contained in:
Lukas Stockner
2018-06-15 11:03:29 +02:00
committed by Brecht Van Lommel
parent 2b9edbc98b
commit 799779d432
34 changed files with 403 additions and 162 deletions

View File

@@ -996,24 +996,6 @@ ccl_device void svm_node_closure_holdout(ShaderData *sd, float *stack, uint4 nod
sd->flag |= SD_HOLDOUT;
}
ccl_device void svm_node_closure_ambient_occlusion(ShaderData *sd, float *stack, uint4 node)
{
uint mix_weight_offset = node.y;
if(stack_valid(mix_weight_offset)) {
float mix_weight = stack_load_float(stack, mix_weight_offset);
if(mix_weight == 0.0f)
return;
closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, sd->svm_closure_weight * mix_weight);
}
else
closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, sd->svm_closure_weight);
sd->flag |= SD_AO;
}
/* Closure Nodes */
ccl_device_inline void svm_node_closure_store_weight(ShaderData *sd, float3 weight)