[Bf-blender-cvs] [3a516f7555a] master: GPU: Cleanup: Code Style

Clément Foucault noreply at git.blender.org
Fri Mar 22 19:43:14 CET 2019


Commit: 3a516f7555ad9483d87d9b9a95e29748b85bcfac
Author: Clément Foucault
Date:   Fri Mar 22 19:38:03 2019 +0100
Branches: master
https://developer.blender.org/rB3a516f7555ad9483d87d9b9a95e29748b85bcfac

GPU: Cleanup: Code Style

===================================================================

M	source/blender/gpu/shaders/gpu_shader_material.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 6ce3f6e0cd6..889a17ef549 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -1604,11 +1604,11 @@ void node_volume_principled(
 	/* Compute density. */
 	density = max(density, 0.0);
 
-	if(density > 1e-5) {
+	if (density > 1e-5) {
 		density = max(density * density_attribute, 0.0);
 	}
 
-	if(density > 1e-5) {
+	if (density > 1e-5) {
 		/* Compute scattering and absorption coefficients. */
 		vec3 scatter_color = color.rgb * color_attribute.rgb;
 
@@ -1620,20 +1620,21 @@ void node_volume_principled(
 	/* Compute emission. */
 	emission_strength = max(emission_strength, 0.0);
 
-	if(emission_strength > 1e-5) {
+	if (emission_strength > 1e-5) {
 		emission_coeff += emission_strength * emission_color.rgb;
 	}
 
-	if(blackbody_intensity > 1e-3) {
+	if (blackbody_intensity > 1e-3) {
 		/* Add temperature from attribute. */
 		float T = max(temperature * max(temperature_attribute, 0.0), 0.0);
 
 		/* Stefan-Boltzman law. */
-		float T4 = (T * T) * (T * T);
+		float T2 = T * T;
+		float T4 = T2 * T2;
 		float sigma = 5.670373e-8 * 1e-6 / M_PI;
 		float intensity = sigma * mix(1.0, T4, blackbody_intensity);
 
-		if(intensity > 1e-5) {
+		if (intensity > 1e-5) {
 			vec4 bb;
 			node_blackbody(T, spectrummap, layer, bb);
 			emission_coeff += bb.rgb * blackbody_tint.rgb * intensity;



More information about the Bf-blender-cvs mailing list