From 3661a929e6f90c77ae607eb0901681b86c3490c9 Mon Sep 17 00:00:00 2001 From: Lolbot Date: Fri, 8 Feb 2013 02:05:10 +0000 Subject: [PATCH] fixed 4 files out of 2376: - removed 7 CR characters - removed 5 trailing whitespaces - replaced 24 tabs with spaces --- src/easymesh/easymesh.cpp | 2 +- src/easymesh/shiny_SK.lolfx | 28 ++++++++++++++-------------- test/shinyfur.lolfx | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index dc4e2264..2c7d009a 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -648,7 +648,7 @@ void EasyMesh::ComputeTexCoord(float uv_scale, int uv_offset) #if VERTEX_USEAGE == VU_TEX_UV VertexDictionnary vert_dict; Array tri_list; - + tri_list.Reserve(m_indices.Count() - m_cursors.Last().m2); for (int i = m_cursors.Last().m2; i < m_indices.Count(); i++) { diff --git a/src/easymesh/shiny_SK.lolfx b/src/easymesh/shiny_SK.lolfx index c5a55bad..4f651713 100644 --- a/src/easymesh/shiny_SK.lolfx +++ b/src/easymesh/shiny_SK.lolfx @@ -107,23 +107,23 @@ void main(void) //Light calculation for cube light //const float cos_45 = 0.70710678118; //const float inv_cos_45 = 0.29289321881; - vec3 local_vertex = (in_Inv_View * pass_Vertex).xyz - (in_Light3_Pos).xyz; - vec3 proj_vertex = clamp(local_vertex.xyz, -in_Light3_Size_Inner, in_Light3_Size_Inner); - vec3 proj_local_dir = local_vertex - proj_vertex; + vec3 local_vertex = (in_Inv_View * pass_Vertex).xyz - (in_Light3_Pos).xyz; + vec3 proj_vertex = clamp(local_vertex.xyz, -in_Light3_Size_Inner, in_Light3_Size_Inner); + vec3 proj_local_dir = local_vertex - proj_vertex; vec3 inner_dir = proj_vertex / in_Light3_Size_Inner; inner_dir.x = (inner_dir.x == 1.0)?(1.0):(0.0); inner_dir.y = (inner_dir.y == 1.0)?(1.0):(0.0); inner_dir.z = (inner_dir.z == 1.0)?(1.0):(0.0); //inside the cube - if (length(proj_local_dir) == 0.0) + if (length(proj_local_dir) == 0.0) { - sdotn = 1.0; + sdotn = 1.0; light_radius_mod = 1.0; } //spec calculation - else - { + else + { //Distance calculation vec3 proj_local_light = proj_local_dir / in_Light3_Size_Outer; light_radius_mod = max(0.0, 1.0 - length(proj_local_light)); @@ -138,14 +138,14 @@ void main(void) // //vec3 proj_local_light = max(vec3(0.0,0.0,0.0), vec3(1.0,1.0,1.0) - abs(proj_local_dir / in_Light3_Size_Outer)); //} /* - proj_local_dir = normalize((in_View * vec4(proj_vertex + in_Light3_Pos.xyz,1.0)).xyz - pass_Vertex.xyz); - sdotn = max(dot(proj_local_dir, pass_TNormal), 0.0); - r = reflect(-proj_local_dir, pass_TNormal); - if (sdotn > 0.0 && light_radius_mod > 0.0) - specular += specular_color * min(specular_reflect, light_radius_mod) - * pow(max(dot(r, v), 0.0), specular_power); + proj_local_dir = normalize((in_View * vec4(proj_vertex + in_Light3_Pos.xyz,1.0)).xyz - pass_Vertex.xyz); + sdotn = max(dot(proj_local_dir, pass_TNormal), 0.0); + r = reflect(-proj_local_dir, pass_TNormal); + if (sdotn > 0.0 && light_radius_mod > 0.0) + specular += specular_color * min(specular_reflect, light_radius_mod) + * pow(max(dot(r, v), 0.0), specular_power); */ - } + } //diffuse calculation diffuse += in_Light3_diffuse * sdotn; //min(sdotn, light_radius_mod); //---------- diff --git a/test/shinyfur.lolfx b/test/shinyfur.lolfx index de5d124c..10f16857 100644 --- a/test/shinyfur.lolfx +++ b/test/shinyfur.lolfx @@ -105,7 +105,7 @@ void main(void) float mod = 2.0; float transp = dam_perc; /* - abs(sin(world_vertex.x * mod) * dam_perc * 0.5 + 0.5) * + abs(sin(world_vertex.x * mod) * dam_perc * 0.5 + 0.5) * abs(sin(world_vertex.y * mod) * dam_perc * 0.5 + 0.5) * abs(sin(world_vertex.z * mod) * dam_perc * 0.5 + 0.5) */