Changeset 2232 for trunk/src/easymesh
- Timestamp:
- Jan 18, 2013, 12:16:52 AM (7 years ago)
- Location:
- trunk/src/easymesh
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/easymesh/csgbsp.cpp
r2231 r2232 140 140 141 141 tri_to_process.Pop(); 142 142 143 143 #if 1 144 144 if (m_tree[leaf_idx].m_leaves[leaf_type] == LEAF_CURRENT) … … 499 499 int res_total = 0; 500 500 int res_nb[3] = { 0, 0, 0 }; 501 501 502 502 int res_Leaf[4] = { 0, 0, 0, 0 }; 503 503 int res_side[4] = { -1, -1, -1, -1 }; -
trunk/src/easymesh/easymesh-scanner.l
r2226 r2232 67 67 sz { return token::T_SCALEZ; } 68 68 s { return token::T_SCALE; } 69 tsw 69 tsw { return token::T_TOGGLESCALEWINDING; } 70 70 mx { return token::T_MIRRORX; } 71 71 my { return token::T_MIRRORY; } -
trunk/src/easymesh/easymesh.cpp
r2229 r2232 176 176 { 177 177 int CurIdx = FindVertexInDict(i, vertex_dict); 178 178 179 179 //go through all vertices and do the match-up. 180 180 if (CurIdx == -1) -
trunk/src/easymesh/shiny.lolfx
r2227 r2232 77 77 vec3 r = vec3(0.0, 0.0, 0.0); 78 78 float sdotn = 0.0; 79 79 float light_radius_mod = 0.0; 80 80 81 81 //Light calculation for directional light … … 89 89 specular += specular_color * specular_reflect 90 90 * pow(max(dot(r, v), 0.0), specular_power); 91 92 91 //---------- 92 93 93 //Light calculation for point light 94 95 94 vec3 tmpLightDir = (in_View * in_Light2_Pos).xyz - pass_Vertex.xyz; 95 light_radius_mod = max(0.0, 1.0 - (length(tmpLightDir) / in_Light2_Radius)); 96 96 s = normalize(tmpLightDir); 97 97 v = normalize(-pass_Vertex.xyz); … … 103 103 specular += specular_color * min(specular_reflect, light_radius_mod) 104 104 * pow(max(dot(r, v), 0.0), specular_power); 105 106 105 //---------- 106 107 107 //Light calculation for cube light 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 108 vec3 Local_Vertex = (in_Inv_View * pass_Vertex).xyz - (in_Light3_Pos).xyz; 109 vec3 Proj_Vertex = clamp(Local_Vertex.xyz, -in_Light3_Size_Inner, in_Light3_Size_Inner); 110 vec3 new_LightDir = Local_Vertex - Proj_Vertex; 111 112 vec3 light_radius = max(vec3(0.0,0.0,0.0), vec3(1.0,1.0,1.0) - abs(new_LightDir / in_Light3_Size_Outer)); 113 light_radius_mod = min(light_radius.x, min(light_radius.y, light_radius.z)); 114 115 if (length(new_LightDir) == 0.0) 116 sdotn = 1.0; 117 else 118 { 119 new_LightDir = normalize((in_View * vec4(Proj_Vertex + in_Light3_Pos.xyz,1.0)).xyz - pass_Vertex.xyz); 120 sdotn = max(dot(new_LightDir, pass_TNormal), 0.0); 121 r = reflect(-new_LightDir, pass_TNormal); 122 if (sdotn > 0.0 && light_radius_mod > 0.0) 123 specular += specular_color * min(specular_reflect, light_radius_mod) 124 * pow(max(dot(r, v), 0.0), specular_power); 125 } 126 126 diffuse += in_Light3_diffuse * min(sdotn, light_radius_mod); 127 127 //---------- 128 128 129 129 vec3 light = ambient + diffuse + specular;
Note: See TracChangeset
for help on using the changeset viewer.