diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-31 07:28:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-31 07:28:46 +0400 |
commit | e8d532f1dde96c40c1407d39260724fcfee0b606 (patch) | |
tree | 36264f1310ab0dd9af959d09373e7ad6a5e13126 /source/blender/gpu | |
parent | 2c58e96685e80e4e12dfad56ed3bb51fa3824197 (diff) |
style cleanup
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 6 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_simple_frag.glsl | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 840b16a4567..ae1eb62bc18 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -475,7 +475,7 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes) /* create exactly one sampler for each texture */ if (codegen_input_has_texture(input) && input->bindtex) BLI_dynstr_appendf(ds, "uniform %s samp%d;\n", - (input->textype == GPU_TEX2D)? "sampler2D": "sampler2DShadow", + (input->textype == GPU_TEX2D) ? "sampler2D" : "sampler2DShadow", input->texid); } else if (input->source == GPU_SOURCE_BUILTIN) { diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 33402426b62..b772507e0cc 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1295,7 +1295,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O GMS.gob = ob; GMS.gscene = scene; - GMS.totmat= use_matcap? 1 : ob->totcol+1; /* materials start from 1, default material is 0 */ + GMS.totmat = use_matcap ? 1 : ob->totcol + 1; /* materials start from 1, default material is 0 */ GMS.glay= (v3d->localvd)? v3d->localvd->lay: v3d->lay; /* keep lamps visible in local view */ GMS.gviewmat= rv3d->viewmat; GMS.gviewinv= rv3d->viewinv; diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index c455e8f7642..e8d28877043 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -393,7 +393,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in if (fpixels) { glTexSubImage1D(tex->target, 0, 0, w, format, type, - pixels? pixels: fpixels); + pixels ? pixels : fpixels); if (tex->w > w) GPU_glTexSubImageEmpty(tex->target, format, w, 0, @@ -406,7 +406,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in if (fpixels) { glTexSubImage2D(tex->target, 0, 0, 0, w, h, - format, type, pixels? pixels: fpixels); + format, type, pixels ? pixels : fpixels); if (tex->w > w) GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w-w, tex->h); diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 4fc04175bba..147d002475b 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -93,7 +93,7 @@ void hsv_to_rgb(vec4 hsv, out vec4 outcol) float srgb_to_linearrgb(float c) { if(c < 0.04045) - return (c < 0.0)? 0.0: c * (1.0/12.92); + return (c < 0.0) ? 0.0: c * (1.0 / 12.92); else return pow((c + 0.055)*(1.0/1.055), 2.4); } @@ -101,7 +101,7 @@ float srgb_to_linearrgb(float c) float linearrgb_to_srgb(float c) { if(c < 0.0031308) - return (c < 0.0)? 0.0: c * 12.92; + return (c < 0.0) ? 0.0: c * 12.92; else return 1.055 * pow(c, 1.0/2.4) - 0.055; } @@ -2098,7 +2098,7 @@ void node_add_shader(vec4 shader1, vec4 shader2, out vec4 shader) void node_fresnel(float ior, vec3 N, vec3 I, out float result) { float eta = max(ior, 0.00001); - result = fresnel_dielectric(I, N, eta); //backfacing()? 1.0/eta: eta); + result = fresnel_dielectric(I, N, eta); //backfacing() ? 1.0/eta: eta); } /* geometry */ diff --git a/source/blender/gpu/shaders/gpu_shader_simple_frag.glsl b/source/blender/gpu/shaders/gpu_shader_simple_frag.glsl index 9610e0cf5aa..94c73d9e248 100644 --- a/source/blender/gpu/shaders/gpu_shader_simple_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_simple_frag.glsl @@ -70,7 +70,7 @@ void main() #ifndef NO_SPECULAR /* view vector computation, depends on orthographics or perspective */ - vec3 V = (gl_ProjectionMatrix[3][3] == 0.0)? normalize(varying_position): vec3(0.0, 0.0, -1.0); + vec3 V = (gl_ProjectionMatrix[3][3] == 0.0) ? normalize(varying_position): vec3(0.0, 0.0, -1.0); #endif for (int i = 0; i < NUM_SCENE_LIGHTS; i++) { |