Changeset 854 for trunk/src/scene.cpp
 Timestamp:
 Aug 23, 2011, 2:14:37 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/scene.cpp
r832 r854 181 181 #if 0 182 182 " float mul = 2.0;\n" 183 #if 0183 #if 1 184 184 " vec2 d1 = mod(vec2(gl_FragCoord), vec2(2.0, 2.0));\n" 185 185 " float t1 = mod(3.0 * d1.x + 2.0 * d1.y, 4.0);\n" … … 190 190 " float dy3 = mod(floor(gl_FragCoord.y * 0.25), 2.0);\n" 191 191 " float t3 = mod(3.0 * dx3 + 2.0 * dy3, 4.0);\n" 192 " floatt1 = (1.0 + 16.0 * t1 + 4.0 * t2 + t3) / 65.0;\n"193 " floatt2 = t1;\n"194 " floatt3 = t1;\n"192 " t1 = (1.0 + 16.0 * t1 + 4.0 * t2 + t3) / 65.0;\n" 193 " t2 = t1;\n" 194 " t3 = t1;\n" 195 195 #else 196 196 " float rand = sin(gl_FragCoord.x * 1.23456) * 123.456\n" … … 227 227 228 228 "void main(float2 in_TexCoord : TEXCOORD0," 229 " float4 in_FragCoord : WPOS," 229 230 " uniform sampler2D tex," 230 231 " out float4 out_FragColor : COLOR)" 231 232 "{" 232 " out_FragColor = tex2D(tex, in_TexCoord);" 233 " float4 col = tex2D(tex, in_TexCoord);" 234 #if 0 235 " float mul = 2.0;\n" 236 " float t1, t2, t3;\n" 237 #if 1 238 " float dx1 = frac(in_FragCoord.x * 0.5) * 2.0;\n" 239 " float dy1 = frac(in_FragCoord.y * 0.5) * 2.0;\n" 240 " t1 = frac((3.0 * dx1 + 2.0 * dy1) / 4.0) * 4.0;\n" 241 " float dx2 = frac(floor(in_FragCoord.x * 0.5) * 0.5) * 2.0;\n" 242 " float dy2 = frac(floor(in_FragCoord.y * 0.5) * 0.5) * 2.0;\n" 243 " t2 = frac((3.0 * dx2 + 2.0 * dy2) / 4.0) * 4.0;\n" 244 " float dx3 = frac(floor(in_FragCoord.x * 0.25) * 0.5) * 2.0;\n" 245 " float dy3 = frac(floor(in_FragCoord.y * 0.25) * 0.5) * 2.0;\n" 246 " t3 = frac((3.0 * dx3 + 2.0 * dy3) / 4.0) * 4.0;\n" 247 " t1 = (1.0 + 4.0 * t1 + t2) / 17.0;\n" 248 " t2 = t1;\n" 249 " t3 = t1;\n" 250 #else 251 " float rand = sin(in_FragCoord.x * 1.23456) * 123.456\n" 252 " + cos(in_FragCoord.y * 2.34567) * 789.012;\n" 253 " t1 = frac(sin(rand) * 17.13043);\n" 254 " t2 = frac(sin(rand) * 27.13043);\n" 255 " t3 = frac(sin(rand) * 37.13043);\n" 256 #endif 257 " float fracx = frac(col.x * mul);\n" 258 " float fracy = frac(col.y * mul);\n" 259 " float fracz = frac(col.z * mul);\n" 260 " fracx = fracx > t1 ? 1.0 : 0.0;\n" 261 " fracy = fracy > t2 ? 1.0 : 0.0;\n" 262 " fracz = fracz > t3 ? 1.0 : 0.0;\n" 263 " col.x = (floor(col.x * mul) + fracx) / mul;\n" 264 " col.y = (floor(col.y * mul) + fracy) / mul;\n" 265 " col.z = (floor(col.z * mul) + fracz) / mul;\n" 266 #endif 267 " out_FragColor = col;" 233 268 "}"); 234 269 #endif
Note: See TracChangeset
for help on using the changeset viewer.