diff options
Diffstat (limited to 'intern/cycles/render')
47 files changed, 114 insertions, 158 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index 8c77687d9cc..a7450849195 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -202,7 +202,7 @@ bool Attribute::same_storage(TypeDesc a, TypeDesc b) { if(a == b) return true; - + if(a == TypeDesc::TypeColor || a == TypeDesc::TypePoint || a == TypeDesc::TypeVector || a == TypeDesc::TypeNormal) { @@ -292,7 +292,7 @@ const char *Attribute::standard_name(AttributeStandard std) case ATTR_STD_NUM: return ""; } - + return ""; } @@ -476,7 +476,7 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) } attr->std = std; - + return attr; } @@ -682,7 +682,7 @@ bool AttributeRequestSet::find(ustring name) foreach(AttributeRequest& req, requests) if(req.name == name) return true; - + return false; } @@ -706,4 +706,3 @@ void AttributeRequestSet::clear() } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/attribute.h b/intern/cycles/render/attribute.h index 5cb6c75aab2..40e5be2e1b2 100644 --- a/intern/cycles/render/attribute.h +++ b/intern/cycles/render/attribute.h @@ -173,4 +173,3 @@ public: CCL_NAMESPACE_END #endif /* __ATTRIBUTE_H__ */ - diff --git a/intern/cycles/render/background.cpp b/intern/cycles/render/background.cpp index df3b65be110..d8a49bf6a5e 100644 --- a/intern/cycles/render/background.cpp +++ b/intern/cycles/render/background.cpp @@ -62,7 +62,7 @@ void Background::device_update(Device *device, DeviceScene *dscene, Scene *scene { if(!need_update) return; - + device_free(device, dscene); Shader *bg_shader = shader; @@ -135,4 +135,3 @@ void Background::tag_update(Scene *scene) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/background.h b/intern/cycles/render/background.h index 145c05f1c18..3f56dedb2c8 100644 --- a/intern/cycles/render/background.h +++ b/intern/cycles/render/background.h @@ -60,4 +60,3 @@ public: CCL_NAMESPACE_END #endif /* __BACKGROUND_H__ */ - diff --git a/intern/cycles/render/bake.h b/intern/cycles/render/bake.h index fbb8686b8f6..a811eac3327 100644 --- a/intern/cycles/render/bake.h +++ b/intern/cycles/render/bake.h @@ -84,4 +84,3 @@ private: CCL_NAMESPACE_END #endif /* __BAKE_H__ */ - diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index 6f560380b40..1724e254819 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -448,4 +448,3 @@ bool DisplayBuffer::draw_ready() } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/buffers.h b/intern/cycles/render/buffers.h index ee7c0490dfd..1b06ffe33a6 100644 --- a/intern/cycles/render/buffers.h +++ b/intern/cycles/render/buffers.h @@ -147,4 +147,3 @@ public: CCL_NAMESPACE_END #endif /* __BUFFERS_H__ */ - diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 734cdffd5c5..cc3dd1c923b 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -246,7 +246,7 @@ void Camera::update(Scene *scene) cameratoscreen = projection_orthographic(nearclip, farclip); else cameratoscreen = projection_identity(); - + ProjectionTransform screentocamera = projection_inverse(cameratoscreen); rastertocamera = screentocamera * rastertoscreen; diff --git a/intern/cycles/render/camera.h b/intern/cycles/render/camera.h index 37d05c01bd9..323f2c61ca4 100644 --- a/intern/cycles/render/camera.h +++ b/intern/cycles/render/camera.h @@ -181,7 +181,7 @@ public: /* functions */ Camera(); ~Camera(); - + void compute_auto_viewplane(); void update(Scene *scene); @@ -213,4 +213,3 @@ private: CCL_NAMESPACE_END #endif /* __CAMERA_H__ */ - diff --git a/intern/cycles/render/constant_fold.h b/intern/cycles/render/constant_fold.h index cc24d614206..26fa4e8b1c8 100644 --- a/intern/cycles/render/constant_fold.h +++ b/intern/cycles/render/constant_fold.h @@ -71,4 +71,3 @@ public: CCL_NAMESPACE_END #endif /* __CONSTANT_FOLD_H__ */ - diff --git a/intern/cycles/render/curves.cpp b/intern/cycles/render/curves.cpp index 4c085b928fb..58b71d3e122 100644 --- a/intern/cycles/render/curves.cpp +++ b/intern/cycles/render/curves.cpp @@ -188,4 +188,3 @@ void CurveSystemManager::tag_update_mesh() need_mesh_update = true; } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/curves.h b/intern/cycles/render/curves.h index 8834764bd63..62066d8a809 100644 --- a/intern/cycles/render/curves.h +++ b/intern/cycles/render/curves.h @@ -120,4 +120,3 @@ public: CCL_NAMESPACE_END #endif /* __CURVES_H__ */ - diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index 69828cc78da..8f3596ade58 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -175,11 +175,11 @@ bool Pass::equals(const array<Pass>& A, const array<Pass>& B) { if(A.size() != B.size()) return false; - + for(int i = 0; i < A.size(); i++) if(A[i].type != B[i].type) return false; - + return true; } @@ -188,7 +188,7 @@ bool Pass::contains(const array<Pass>& passes, PassType type) for(size_t i = 0; i < passes.size(); i++) if(passes[i].type == type) return true; - + return false; } @@ -302,7 +302,7 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) { if(!need_update) return; - + device_free(device, dscene, scene); KernelFilm *kfilm = &dscene->data.film; @@ -510,4 +510,3 @@ void Film::tag_update(Scene * /*scene*/) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/film.h b/intern/cycles/render/film.h index 29b1e7e9157..6ab2eea79b8 100644 --- a/intern/cycles/render/film.h +++ b/intern/cycles/render/film.h @@ -93,4 +93,3 @@ public: CCL_NAMESPACE_END #endif /* __FILM_H__ */ - diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index 8b179f742c4..78a2039c423 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -745,7 +745,7 @@ void ShaderGraph::clean(Scene *scene) vector<bool> visited(num_node_ids, false); vector<bool> on_stack(num_node_ids, false); - + /* break cycles */ break_cycles(output(), visited, on_stack); @@ -860,7 +860,7 @@ void ShaderGraph::refine_bump_nodes() copy_nodes(nodes_bump, nodes_dx); copy_nodes(nodes_bump, nodes_dy); - + /* mark nodes to indicate they are use for bump computation, so that any texture coordinates are shifted by dx/dy when sampling */ foreach(ShaderNode *node, nodes_bump) @@ -876,13 +876,13 @@ void ShaderGraph::refine_bump_nodes() connect(out_dx, node->input("SampleX")); connect(out_dy, node->input("SampleY")); - + /* add generated nodes */ foreach(NodePair& pair, nodes_dx) add(pair.second); foreach(NodePair& pair, nodes_dy) add(pair.second); - + /* connect what is connected is bump to samplecenter input*/ connect(out , node->input("SampleCenter")); @@ -941,7 +941,7 @@ void ShaderGraph::bump_from_displacement(bool use_object_space) * this for bump from displacement, this will be the only bump allowed to * overwrite the shader normal */ ShaderNode *set_normal = add(new SetNormalNode()); - + /* add bump node and connect copied graphs to it */ BumpNode *bump = (BumpNode*)add(new BumpNode()); bump->use_object_space = use_object_space; @@ -973,7 +973,7 @@ void ShaderGraph::bump_from_displacement(bool use_object_space) connect(dot_center->output("Value"), bump->input("SampleCenter")); connect(dot_dx->output("Value"), bump->input("SampleX")); connect(dot_dy->output("Value"), bump->input("SampleY")); - + /* connect the bump out to the set normal in: */ connect(bump->output("Normal"), set_normal->input("Direction")); @@ -996,7 +996,7 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight * the graph into nodes that feed weights into closure nodes. this is too * avoid building a closure tree and then flattening it, and instead write it * directly to an array */ - + if(node->special_type == SHADER_SPECIAL_TYPE_COMBINE_CLOSURE) { ShaderInput *fin = node->input("Fac"); ShaderInput *cl1in = node->input("Closure1"); @@ -1007,8 +1007,8 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight /* mix closure: add node to mix closure weights */ MixClosureWeightNode *mix_node = new MixClosureWeightNode(); add(mix_node); - ShaderInput *fac_in = mix_node->input("Fac"); - ShaderInput *weight_in = mix_node->input("Weight"); + ShaderInput *fac_in = mix_node->input("Fac"); + ShaderInput *weight_in = mix_node->input("Weight"); if(fin->link) connect(fin->link, fac_in); @@ -1171,4 +1171,3 @@ void ShaderGraph::dump_graph(const char *filename) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h index 5d986ae4827..426522066b3 100644 --- a/intern/cycles/render/graph.h +++ b/intern/cycles/render/graph.h @@ -165,7 +165,7 @@ public: int id; /* index in graph node array */ ShaderBump bump; /* for bump mapping utility */ - + ShaderNodeSpecialType special_type; /* special node type */ /* ** Selective nodes compilation ** */ @@ -294,4 +294,3 @@ protected: CCL_NAMESPACE_END #endif /* __GRAPH_H__ */ - diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp index 3c49d17aa82..7f0660cee07 100644 --- a/intern/cycles/render/image.cpp +++ b/intern/cycles/render/image.cpp @@ -1034,4 +1034,3 @@ void ImageManager::device_free(Device *device) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index 4fd09adaa64..5932c24cb74 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -167,4 +167,3 @@ private: CCL_NAMESPACE_END #endif /* __IMAGE_H__ */ - diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp index 9c276bcab31..d86eb8fc5d3 100644 --- a/intern/cycles/render/integrator.cpp +++ b/intern/cycles/render/integrator.cpp @@ -118,7 +118,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene } /* Transparent Shadows - * We only need to enable transparent shadows, if we actually have + * We only need to enable transparent shadows, if we actually have * transparent shaders in the scene. Otherwise we can disable it * to improve performance a bit. */ kintegrator->transparent_shadows = false; @@ -141,7 +141,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene kintegrator->use_ambient_occlusion = ((Pass::contains(scene->film->passes, PASS_AO)) || dscene->data.background.ao_factor != 0.0f); - + kintegrator->sample_clamp_direct = (sample_clamp_direct == 0.0f)? FLT_MAX: sample_clamp_direct*3.0f; kintegrator->sample_clamp_indirect = (sample_clamp_indirect == 0.0f)? FLT_MAX: sample_clamp_indirect*3.0f; @@ -236,4 +236,3 @@ void Integrator::tag_update(Scene *scene) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h index 3cb430d72b4..f68400ac416 100644 --- a/intern/cycles/render/integrator.h +++ b/intern/cycles/render/integrator.h @@ -75,7 +75,7 @@ public: NUM_METHODS, }; - + Method method; SamplingPattern sampling_pattern; @@ -95,4 +95,3 @@ public: CCL_NAMESPACE_END #endif /* __INTEGRATOR_H__ */ - diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 122c5dfb07a..da29e1a255a 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -759,7 +759,7 @@ void LightManager::device_update_points(Device *, float area = len(axisu)*len(axisv); float invarea = (area > 0.0f)? 1.0f/area: 1.0f; float3 dir = light->dir; - + dir = safe_normalize(dir); if(light->use_mis && area > 0.0f) @@ -788,7 +788,7 @@ void LightManager::device_update_points(Device *, float spot_angle = cosf(light->spot_angle*0.5f); float spot_smooth = (1.0f - spot_angle)*light->spot_smooth; float3 dir = light->dir; - + dir = safe_normalize(dir); if(light->use_mis && radius > 0.0f) @@ -1027,4 +1027,3 @@ void LightManager::device_update_ies(DeviceScene *dscene) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h index 5f8677ee2f2..32a911dc256 100644 --- a/intern/cycles/render/light.h +++ b/intern/cycles/render/light.h @@ -140,4 +140,3 @@ protected: CCL_NAMESPACE_END #endif /* __LIGHT_H__ */ - diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h index e370f8a2021..e7dc1c8e5cf 100644 --- a/intern/cycles/render/mesh.h +++ b/intern/cycles/render/mesh.h @@ -388,4 +388,3 @@ protected: CCL_NAMESPACE_END #endif /* __MESH_H__ */ - diff --git a/intern/cycles/render/mesh_displace.cpp b/intern/cycles/render/mesh_displace.cpp index ad2a5713bcb..53b9bfa3451 100644 --- a/intern/cycles/render/mesh_displace.cpp +++ b/intern/cycles/render/mesh_displace.cpp @@ -89,7 +89,7 @@ bool MeshManager::displace(Device *device, DeviceScene *dscene, Scene *scene, Me int object = object_index; int prim = mesh->tri_offset + i; float u, v; - + switch(j) { case 0: u = 1.0f; @@ -113,7 +113,7 @@ bool MeshManager::displace(Device *device, DeviceScene *dscene, Scene *scene, Me if(d_input_size == 0) return false; - + /* run device task */ device_vector<float4> d_output(device, "displace_output", MEM_READ_WRITE); d_output.alloc(d_input_size); @@ -319,4 +319,3 @@ bool MeshManager::displace(Device *device, DeviceScene *dscene, Scene *scene, Me } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/mesh_subdivision.cpp b/intern/cycles/render/mesh_subdivision.cpp index 9dd81eb6700..13fda99e9cc 100644 --- a/intern/cycles/render/mesh_subdivision.cpp +++ b/intern/cycles/render/mesh_subdivision.cpp @@ -613,4 +613,3 @@ void Mesh::tessellate(DiagSplit *split) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 601d72c4b1b..beff7f91348 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -82,7 +82,7 @@ Transform TextureMapping::compute_transform() mmat[1][y_mapping-1] = 1.0f; if(z_mapping != NONE) mmat[2][z_mapping-1] = 1.0f; - + float3 scale_clamped = scale; if(type == TEXTURE || type == NORMAL) { @@ -94,7 +94,7 @@ Transform TextureMapping::compute_transform() if(fabsf(scale.z) < 1e-5f) scale_clamped.z = signf(scale.z)*1e-5f; } - + Transform smat = transform_scale(scale_clamped); Transform rmat = transform_euler(rotation); Transform tmat = transform_translate(translation); @@ -137,12 +137,12 @@ bool TextureMapping::skip() return false; if(scale != make_float3(1.0f, 1.0f, 1.0f)) return false; - + if(x_mapping != X || y_mapping != Y || z_mapping != Z) return false; if(use_minmax) return false; - + return true; } @@ -520,7 +520,7 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler) compiler.stack_assign_if_linked(alpha_out), srgb), projection); - + tex_mapping.compile_end(compiler, vector_in, vector_offset); } else { @@ -612,7 +612,7 @@ static void sky_texture_precompute_old(SunSky *sunsky, float3 dir, float turbidi * zenith_Y/x/y is now radiance_x/y/z * perez_Y/x/y is now config_x/y/z */ - + float2 spherical = sky_spherical_coordinates(dir); float theta = spherical.x; float phi = spherical.y; @@ -676,12 +676,12 @@ static void sky_texture_precompute_new(SunSky *sunsky, float3 dir, float turbidi float2 spherical = sky_spherical_coordinates(dir); float theta = spherical.x; float phi = spherical.y; - + /* Clamp Turbidity */ - turbidity = clamp(turbidity, 0.0f, 10.0f); - + turbidity = clamp(turbidity, 0.0f, 10.0f); + /* Clamp to Horizon */ - theta = clamp(theta, 0.0f, M_PI_2_F); + theta = clamp(theta, 0.0f, M_PI_2_F); sunsky->theta = theta; sunsky->phi = phi; @@ -773,7 +773,7 @@ void SkyTextureNode::compile(OSLCompiler& compiler) sky_texture_precompute_new(&sunsky, sun_direction, turbidity, ground_albedo); else assert(false); - + compiler.parameter(this, "type"); compiler.parameter("theta", sunsky.theta); compiler.parameter("phi", sunsky.phi); @@ -1296,7 +1296,7 @@ void CheckerTextureNode::compile(SVMCompiler& compiler) ShaderInput *color1_in = input("Color1"); ShaderInput *color2_in = input("Color2"); ShaderInput *scale_in = input("Scale"); - + ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); @@ -1371,7 +1371,7 @@ void BrickTextureNode::compile(SVMCompiler& compiler) ShaderInput *bias_in = input("Bias"); ShaderInput *brick_width_in = input("Brick Width"); ShaderInput *row_height_in = input("Row Height"); - + ShaderOutput *color_out = output("Color"); ShaderOutput *fac_out = output("Fac"); @@ -1393,7 +1393,7 @@ void BrickTextureNode::compile(SVMCompiler& compiler) compiler.stack_assign_if_linked(color_out), compiler.stack_assign_if_linked(fac_out), compiler.stack_assign_if_linked(mortar_smooth_in))); - + compiler.add_node(compiler.encode_uchar4(offset_frequency, squash_frequency), __float_as_int(scale), __float_as_int(mortar_size), @@ -2310,7 +2310,7 @@ ToonBsdfNode::ToonBsdfNode() void ToonBsdfNode::compile(SVMCompiler& compiler) { closure = component; - + BsdfNode::compile(compiler, input("Size"), input("Smooth")); } @@ -2864,7 +2864,7 @@ void VolumeNode::compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput compiler.add_node(NODE_CLOSURE_WEIGHT, compiler.stack_assign(color_in)); else compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color); - + compiler.add_node(NODE_CLOSURE_VOLUME, compiler.encode_uchar4(closure, (param1)? compiler.stack_assign(param1): SVM_STACK_INVALID, @@ -3158,7 +3158,7 @@ void GeometryNode::compile(SVMCompiler& compiler) geom_node = NODE_GEOMETRY_BUMP_DY; attr_node = NODE_ATTR_BUMP_DY; } - + out = output("Position"); if(!out->links.empty()) { compiler.add_node(geom_node, NODE_GEOM_P, compiler.stack_assign(out)); @@ -3287,7 +3287,7 @@ void TextureCoordinateNode::compile(SVMCompiler& compiler) attr_node = NODE_ATTR_BUMP_DY; geom_node = NODE_GEOMETRY_BUMP_DY; } - + out = output("Generated"); if(!out->links.empty()) { if(compiler.background) { @@ -3363,7 +3363,7 @@ void TextureCoordinateNode::compile(OSLCompiler& compiler) compiler.parameter("bump_offset", "dy"); else compiler.parameter("bump_offset", "center"); - + if(compiler.background) compiler.parameter("is_background", true); if(compiler.output_type() == SHADER_TYPE_VOLUME) @@ -3525,7 +3525,7 @@ void LightPathNode::compile(SVMCompiler& compiler) if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_transmission, compiler.stack_assign(out)); } - + out = output("Is Volume Scatter Ray"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_volume_scatter, compiler.stack_assign(out)); @@ -3535,7 +3535,7 @@ void LightPathNode::compile(SVMCompiler& compiler) if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_length, compiler.stack_assign(out)); } - + out = output("Ray Depth"); if(!out->links.empty()) { compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_depth, compiler.stack_assign(out)); @@ -3728,7 +3728,7 @@ void ParticleInfoNode::attributes(Shader *shader, AttributeRequestSet *attribute void ParticleInfoNode::compile(SVMCompiler& compiler) { ShaderOutput *out; - + out = output("Index"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_INDEX, compiler.stack_assign(out)); @@ -3738,22 +3738,22 @@ void ParticleInfoNode::compile(SVMCompiler& compiler) if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_RANDOM, compiler.stack_assign(out)); } - + out = output("Age"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_AGE, compiler.stack_assign(out)); } - + out = output("Lifetime"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_LIFETIME, compiler.stack_assign(out)); } - + out = output("Location"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_LOCATION, compiler.stack_assign(out)); } - + /* quaternion data is not yet supported by Cycles */ #if 0 out = output("Rotation"); @@ -3761,17 +3761,17 @@ void ParticleInfoNode::compile(SVMCompiler& compiler) compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ROTATION, compiler.stack_assign(out)); } #endif - + out = output("Size"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_SIZE, compiler.stack_assign(out)); } - + out = output("Velocity"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_VELOCITY, compiler.stack_assign(out)); } - + out = output("Angular Velocity"); if(!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ANGULAR_VELOCITY, compiler.stack_assign(out)); @@ -3824,7 +3824,7 @@ void HairInfoNode::attributes(Shader *shader, AttributeRequestSet *attributes) void HairInfoNode::compile(SVMCompiler& compiler) { ShaderOutput *out; - + out = output("Is Strand"); if(!out->links.empty()) { compiler.add_node(NODE_HAIR_INFO, NODE_INFO_CURVE_IS_STRAND, compiler.stack_assign(out)); @@ -4747,7 +4747,7 @@ void AttributeNode::compile(OSLCompiler& compiler) compiler.parameter("bump_offset", "dy"); else compiler.parameter("bump_offset", "center"); - + if(Attribute::name_standard(attribute.c_str()) != ATTR_STD_NONE) compiler.parameter("name", (string("geom:") + attribute.c_str()).c_str()); else @@ -5553,7 +5553,7 @@ void RGBRampNode::compile(OSLCompiler& compiler) compiler.parameter_color_array("ramp_color", ramp); compiler.parameter_array("ramp_alpha", ramp_alpha.data(), ramp_alpha.size()); compiler.parameter(this, "interpolate"); - + compiler.add(this, "node_rgb_ramp"); } @@ -5586,7 +5586,7 @@ void SetNormalNode::compile(SVMCompiler& compiler) void SetNormalNode::compile(OSLCompiler& compiler) { - compiler.add(this, "node_set_normal"); + compiler.add(this, "node_set_normal"); } /* OSLNode */ @@ -5707,7 +5707,7 @@ void NormalMapNode::attributes(Shader *shader, AttributeRequestSet *attributes) attributes->add(ATTR_STD_VERTEX_NORMAL); } - + ShaderNode::attributes(shader, attributes); } @@ -5752,7 +5752,7 @@ void NormalMapNode::compile(OSLCompiler& compiler) } compiler.parameter(this, "space"); - compiler.add(this, "node_normal_map"); + compiler.add(this, "node_normal_map"); } /* Tangent */ @@ -5797,7 +5797,7 @@ void TangentNode::attributes(Shader *shader, AttributeRequestSet *attributes) else attributes->add(ATTR_STD_GENERATED); } - + ShaderNode::attributes(shader, attributes); } @@ -5833,7 +5833,7 @@ void TangentNode::compile(OSLCompiler& compiler) compiler.parameter(this, "direction_type"); compiler.parameter(this, "axis"); - compiler.add(this, "node_tangent"); + compiler.add(this, "node_tangent"); } /* Bevel */ diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h index be52cf40a17..f24445ea2e9 100644 --- a/intern/cycles/render/nodes.h +++ b/intern/cycles/render/nodes.h @@ -1121,4 +1121,3 @@ public: CCL_NAMESPACE_END #endif /* __NODES_H__ */ - diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 4d64d841206..e3f35c366d6 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -183,7 +183,7 @@ void Object::apply_transform(bool apply_to_motion) { if(!mesh || tfm == transform_identity()) return; - + /* triangles */ if(mesh->verts.size()) { /* store matrix to transform later. when accessing these as attributes we @@ -194,7 +194,7 @@ void Object::apply_transform(bool apply_to_motion) /* apply to mesh vertices */ for(size_t i = 0; i < mesh->verts.size(); i++) mesh->verts[i] = transform_point(&tfm, mesh->verts[i]); - + if(apply_to_motion) { Attribute *attr = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); @@ -840,4 +840,3 @@ void ObjectManager::tag_update(Scene *scene) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/object.h b/intern/cycles/render/object.h index c7212ae25f9..b80c4aef70b 100644 --- a/intern/cycles/render/object.h +++ b/intern/cycles/render/object.h @@ -129,4 +129,3 @@ protected: CCL_NAMESPACE_END #endif /* __OBJECT_H__ */ - diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index dde622bff8a..fdd872f62b9 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -122,7 +122,7 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene shader->need_update = false; need_update = false; - + /* set texture system */ scene->image_manager->set_osl_texture_system((void*)ts); @@ -578,7 +578,7 @@ string OSLCompiler::compatible_name(ShaderNode *node, ShaderInput *input) /* strip whitespace */ while((i = sname.find(" ")) != string::npos) sname.replace(i, 1, ""); - + /* if output exists with the same name, add "In" suffix */ foreach(ShaderOutput *output, node->outputs) { if(input->name() == output->name()) { @@ -586,7 +586,7 @@ string OSLCompiler::compatible_name(ShaderNode *node, ShaderInput *input) break; } } - + return sname; } @@ -598,7 +598,7 @@ string OSLCompiler::compatible_name(ShaderNode *node, ShaderOutput *output) /* strip whitespace */ while((i = sname.find(" ")) != string::npos) sname.replace(i, 1, ""); - + /* if input exists with the same name, add "Out" suffix */ foreach(ShaderInput *input, node->inputs) { if(input->name() == output->name()) { @@ -606,7 +606,7 @@ string OSLCompiler::compatible_name(ShaderNode *node, ShaderOutput *output) break; } } - + return sname; } @@ -614,7 +614,7 @@ bool OSLCompiler::node_skip_input(ShaderNode *node, ShaderInput *input) { /* exception for output node, only one input is actually used * depending on the current shader type */ - + if(input->flags() & SocketType::SVM_INTERNAL) return true; @@ -704,7 +704,7 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath) ss->Shader("displacement", name, id(node).c_str()); else assert(0); - + /* link inputs to other nodes */ foreach(ShaderInput *input, node->inputs) { if(input->link) { @@ -1250,4 +1250,3 @@ void OSLCompiler::parameter_color_array(const char * /*name*/, const array<float #endif /* WITH_OSL */ CCL_NAMESPACE_END - diff --git a/intern/cycles/render/osl.h b/intern/cycles/render/osl.h index 7a3208c402a..09d1a54d0b9 100644 --- a/intern/cycles/render/osl.h +++ b/intern/cycles/render/osl.h @@ -171,4 +171,3 @@ private: CCL_NAMESPACE_END #endif /* __OSL_H__ */ - diff --git a/intern/cycles/render/particles.cpp b/intern/cycles/render/particles.cpp index e4be3306d7e..0583556c8a9 100644 --- a/intern/cycles/render/particles.cpp +++ b/intern/cycles/render/particles.cpp @@ -61,12 +61,12 @@ void ParticleSystemManager::device_update_particles(Device *, DeviceScene *dscen int num_particles = 1; for(size_t j = 0; j < scene->particle_systems.size(); j++) num_particles += scene->particle_systems[j]->particles.size(); - + KernelParticle *kparticles = dscene->particles.alloc(num_particles); - + /* dummy particle */ memset(kparticles, 0, sizeof(KernelParticle)); - + int i = 1; for(size_t j = 0; j < scene->particle_systems.size(); j++) { ParticleSystem *psys = scene->particle_systems[j]; @@ -74,7 +74,7 @@ void ParticleSystemManager::device_update_particles(Device *, DeviceScene *dscen for(size_t k = 0; k < psys->particles.size(); k++) { /* pack in texture */ Particle& pa = psys->particles[k]; - + kparticles[i].index = pa.index; kparticles[i].age = pa.age; kparticles[i].lifetime = pa.lifetime; @@ -83,13 +83,13 @@ void ParticleSystemManager::device_update_particles(Device *, DeviceScene *dscen kparticles[i].location = float3_to_float4(pa.location); kparticles[i].velocity = float3_to_float4(pa.velocity); kparticles[i].angular_velocity = float3_to_float4(pa.angular_velocity); - + i++; - + if(progress.get_cancel()) return; } } - + dscene->particles.copy_to_device(); } @@ -105,9 +105,9 @@ void ParticleSystemManager::device_update(Device *device, DeviceScene *dscene, S progress.set_status("Updating Particle Systems", "Copying Particles to device"); device_update_particles(device, dscene, scene, progress); - + if(progress.get_cancel()) return; - + need_update = false; } @@ -122,4 +122,3 @@ void ParticleSystemManager::tag_update(Scene * /*scene*/) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/particles.h b/intern/cycles/render/particles.h index 66d46114b3e..7e7afd5d054 100644 --- a/intern/cycles/render/particles.h +++ b/intern/cycles/render/particles.h @@ -69,4 +69,3 @@ public: CCL_NAMESPACE_END #endif /* __PARTICLES_H__ */ - diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index c0f1ae0445e..1d65ef65980 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -319,7 +319,7 @@ bool Scene::need_global_attribute(AttributeStandard std) return need_motion() != MOTION_NONE; else if(std == ATTR_STD_MOTION_VERTEX_NORMAL) return need_motion() == MOTION_BLUR; - + return false; } @@ -380,4 +380,3 @@ void Scene::device_free() } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index 6c67433c9fc..713eba623b1 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -267,4 +267,3 @@ protected: CCL_NAMESPACE_END #endif /* __SCENE_H__ */ - diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 3106ee53832..d0aa985b035 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -364,7 +364,7 @@ bool Session::acquire_tile(Device *tile_device, RenderTile& rtile) if(!tile_manager.next_tile(tile, device_num)) return false; - + /* fill render tile */ rtile.x = tile_manager.state.buffer.full_x + tile->x; rtile.y = tile_manager.state.buffer.full_y + tile->y; @@ -916,7 +916,7 @@ void Session::update_status_time(bool show_pause, bool show_done) substatus = string_printf("Path Tracing Sample %d/%d", progressive_sample+1, num_samples); - + if(show_pause) { status = "Paused"; } @@ -941,7 +941,7 @@ void Session::render() /* Add path trace task. */ DeviceTask task(DeviceTask::RENDER); - + task.acquire_tile = function_bind(&Session::acquire_tile, this, _1, _2); task.release_tile = function_bind(&Session::release_tile, this, _1); task.map_neighbor_tiles = function_bind(&Session::map_neighbor_tiles, this, _1, _2); diff --git a/intern/cycles/render/session.h b/intern/cycles/render/session.h index e63cad0d977..61f62f8e712 100644 --- a/intern/cycles/render/session.h +++ b/intern/cycles/render/session.h @@ -237,4 +237,3 @@ protected: CCL_NAMESPACE_END #endif /* __SESSION_H__ */ - diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index 46e7d1b1d7b..ac605305b94 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -313,7 +313,7 @@ void Shader::tag_update(Scene *scene) if(has_displacement && displacement_method == DISPLACE_BOTH) { attributes.add(ATTR_STD_POSITION_UNDISPLACED); } - + /* compare if the attributes changed, mesh manager will check * need_update_mesh, update the relevant meshes and clear it. */ if(attributes.modified(prev_attributes)) { @@ -398,7 +398,7 @@ ShaderManager *ShaderManager::create(Scene *scene, int shadingsystem) { manager = new SVMShaderManager(); } - + add_default(scene); return manager; @@ -413,7 +413,7 @@ uint ShaderManager::get_attribute_id(ustring name) if(it != unique_attribute_id.end()) return it->second; - + uint id = (uint)ATTR_STD_NUM + unique_attribute_id.size(); unique_attribute_id[name] = id; return id; @@ -432,10 +432,10 @@ int ShaderManager::get_shader_id(Shader *shader, bool smooth) /* smooth flag */ if(smooth) id |= SHADER_SMOOTH_NORMAL; - + /* default flags */ id |= SHADER_CAST_SHADOW|SHADER_AREA_LIGHT; - + return id; } @@ -696,4 +696,3 @@ float ShaderManager::linear_rgb_to_gray(float3 c) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h index 0353da90013..58314a1e310 100644 --- a/intern/cycles/render/shader.h +++ b/intern/cycles/render/shader.h @@ -155,7 +155,7 @@ public: }; /* Shader Manager virtual base class - * + * * From this the SVM and OSL shader managers are derived, that do the actual * shader compiling and device updating. */ @@ -223,4 +223,3 @@ protected: CCL_NAMESPACE_END #endif /* __SHADER_H__ */ - diff --git a/intern/cycles/render/sobol.cpp b/intern/cycles/render/sobol.cpp index 6906667ac19..01dfafa2ed9 100644 --- a/intern/cycles/render/sobol.cpp +++ b/intern/cycles/render/sobol.cpp @@ -7,7 +7,7 @@ * http://web.maths.unsw.edu.au/~fkuo/sobol/ * * From these papers: - * + * * S. Joe and F. Y. Kuo, Remark on Algorithm 659: Implementing Sobol's quasirandom * sequence generator, ACM Trans. Math. Softw. 29, 49-57 (2003) * @@ -18,22 +18,22 @@ /* Copyright (c) 2008, Frances Y. Kuo and Stephen Joe * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * * Neither the names of the copyright holders nor the names of the * University of New South Wales and the University of Waikato * and its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -21284,21 +21284,20 @@ void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions if(L <= s) { for(uint i = 0; i < L; i++) - v[i] = m[i] << (31-i); + v[i] = m[i] << (31-i); } else { for(uint i = 0; i < s; i++) - v[i] = m[i] << (31-i); + v[i] = m[i] << (31-i); for(uint i = s; i < L; i++) { - v[i] = v[i-s] ^ (v[i-s] >> s); + v[i] = v[i-s] ^ (v[i-s] >> s); - for(uint k = 1; k < s; k++) - v[i] ^= (((a >> (s-1-k)) & 1) * v[i-k]); + for(uint k = 1; k < s; k++) + v[i] ^= (((a >> (s-1-k)) & 1) * v[i-k]); } } } } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/sobol.h b/intern/cycles/render/sobol.h index 9fbce4e14a5..d38857d2b35 100644 --- a/intern/cycles/render/sobol.h +++ b/intern/cycles/render/sobol.h @@ -29,4 +29,3 @@ void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions CCL_NAMESPACE_END #endif /* __SOBOL_H__ */ - diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index 626f160786f..44b7eeec6db 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -71,12 +71,12 @@ void SVMShaderManager::device_update_shader(Scene *scene, scene->light_manager->need_update = true; } - /* The copy needs to be done inside the lock, if another thread resizes the array - * while memcpy is running, it'll be copying into possibly invalid/freed ram. + /* The copy needs to be done inside the lock, if another thread resizes the array + * while memcpy is running, it'll be copying into possibly invalid/freed ram. */ size_t global_nodes_size = global_svm_nodes->size(); global_svm_nodes->resize(global_nodes_size + svm_nodes.size()); - + /* Offset local SVM nodes to a global address space. */ int4& jump_node = (*global_svm_nodes)[shader->id]; jump_node.y = svm_nodes[0].y + global_nodes_size - 1; @@ -173,7 +173,7 @@ SVMCompiler::SVMCompiler(ShaderManager *shader_manager_, int SVMCompiler::stack_size(SocketType::Type type) { int size = 0; - + switch(type) { case SocketType::FLOAT: case SocketType::INT: @@ -192,14 +192,14 @@ int SVMCompiler::stack_size(SocketType::Type type) assert(0); break; } - + return size; } int SVMCompiler::stack_find_offset(int size) { int offset = -1; - + /* find free space in stack & mark as used */ for(int i = 0, num_unused = 0; i < SVM_STACK_SIZE; i++) { if(active_stack.users[i]) num_unused = 0; @@ -413,7 +413,7 @@ bool SVMCompiler::node_skip_input(ShaderNode * /*node*/, ShaderInput *input) /* nasty exception .. */ if(current_type == SHADER_TYPE_DISPLACEMENT && input->link && input->link->parent->special_type == SHADER_SPECIAL_TYPE_BUMP) return true; - + return false; } @@ -715,7 +715,7 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty /* get input in output node */ ShaderNode *node = graph->output(); ShaderInput *clin = NULL; - + switch(type) { case SHADER_TYPE_SURFACE: clin = node->input("Surface"); @@ -756,9 +756,9 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty if(shader->used) { if(clin->link) { bool generate = false; - + switch(type) { - case SHADER_TYPE_SURFACE: /* generate surface shader */ + case SHADER_TYPE_SURFACE: /* generate surface shader */ generate = true; shader->has_surface = true; break; @@ -936,4 +936,3 @@ SVMCompiler::CompilerState::CompilerState(ShaderGraph *graph) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h index 7cf1e4ad791..1d0613bbfdc 100644 --- a/intern/cycles/render/svm.h +++ b/intern/cycles/render/svm.h @@ -224,4 +224,3 @@ protected: CCL_NAMESPACE_END #endif /* __SVM_H__ */ - diff --git a/intern/cycles/render/tables.cpp b/intern/cycles/render/tables.cpp index 536fdd0775e..ddbb138f059 100644 --- a/intern/cycles/render/tables.cpp +++ b/intern/cycles/render/tables.cpp @@ -115,4 +115,3 @@ void LookupTables::remove_table(size_t *offset) } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/tables.h b/intern/cycles/render/tables.h index bc261c2a74d..09d961a9c3c 100644 --- a/intern/cycles/render/tables.h +++ b/intern/cycles/render/tables.h @@ -51,4 +51,3 @@ public: CCL_NAMESPACE_END #endif /* __TABLES_H__ */ - diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp index a388f5dfc8b..dc863b067b0 100644 --- a/intern/cycles/render/tile.cpp +++ b/intern/cycles/render/tile.cpp @@ -535,4 +535,3 @@ int TileManager::get_num_effective_samples() } CCL_NAMESPACE_END - diff --git a/intern/cycles/render/tile.h b/intern/cycles/render/tile.h index 2692c7cf9f0..f72f653f4c2 100644 --- a/intern/cycles/render/tile.h +++ b/intern/cycles/render/tile.h @@ -155,4 +155,3 @@ protected: CCL_NAMESPACE_END #endif /* __TILE_H__ */ - |