Changeset 1735 for trunk/tutorial
- Timestamp:
- Aug 13, 2012, 2:25:42 PM (8 years ago)
- Location:
- trunk/tutorial
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tutorial/08_fbo.cpp
r1730 r1735 48 48 lol::sin(m_time * 4.4f) + lol::sin(m_time * 3.2f), 49 49 lol::sin(m_time * 5.f)); 50 m_color = 0.25f * vec3(3.f + lol::sin(m_time * 4.5f + 1.f), 51 3.f + lol::sin(m_time * 2.8f + 1.3f), 52 3.f + lol::sin(m_time * 3.7f)); 50 m_color = 0.25f * vec3(1.1f + lol::sin(m_time * 1.5f + 1.f), 51 1.1f + lol::sin(m_time * 1.8f + 1.3f), 52 1.1f + lol::sin(m_time * 1.7f)); 53 /* Saturate dot color */ 54 float x = std::max(m_color.x, std::max(m_color.y, m_color.z)); 55 m_color /= x; 53 56 } 54 57 … … 61 64 m_shader = Shader::Create(lolfx_08_fbo); 62 65 m_coord = m_shader->GetAttribLocation("in_Position", VertexUsage::Position, 0); 66 m_uni_flag = m_shader->GetUniformLocation("in_Flag"); 63 67 m_uni_point = m_shader->GetUniformLocation("in_Point"); 64 68 m_uni_color = m_shader->GetUniformLocation("in_Color"); 65 m_uni_flag = m_shader->GetUniformLocation("in_Flag");66 69 m_uni_texture = m_shader->GetUniformLocation("in_Texture"); 67 70 -
trunk/tutorial/08_fbo.lolfx
r1734 r1735 32 32 if (in_Flag == 0.0) 33 33 { 34 float s = 4.0 + 4.0 * in_Point.z; 35 vec2 p = pass_Position - in_Point.xy * 0.8; 36 float f = clamp(1.0 - dot(s * p, s * p), 0.0, 1.0); 37 f = sqrt(f); 38 gl_FragColor = vec4(f * in_Color, f + 0.1); 34 float tc = 0.0, ta = 0.0; 35 { 36 float s = 4.0 + 3.0 * in_Point.z; 37 vec2 p = pass_Position - in_Point.xy * 0.8; 38 float t = clamp(1.2 - dot(s * p, s * p), 0.0, 1.0); 39 float u = t * t; 40 tc += 3.0 * t * t - 2.0 * t * t * t; 41 ta += 3.0 * u * u - 2.0 * u * u * u; 42 } 43 44 gl_FragColor = vec4(tc * in_Color, ta + 0.1); 39 45 } 40 46 else
Note: See TracChangeset
for help on using the changeset viewer.