diff options
Diffstat (limited to 'tests/RenderScriptTests/SceneGraph/res/raw')
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/blur_h.glsl | 15 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/blur_v.glsl | 17 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/blur_vertex.glsl | 7 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl | 19 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/metal.glsl | 23 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/paintf.glsl | 26 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/plastic.glsl | 22 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/robot.a3d | bin | 0 -> 144528 bytes | |||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/select_color.glsl | 13 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl | 17 | ||||
-rw-r--r-- | tests/RenderScriptTests/SceneGraph/res/raw/texture.glsl | 7 |
11 files changed, 166 insertions, 0 deletions
diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/blur_h.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/blur_h.glsl new file mode 100644 index 0000000..fa468cc --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/blur_h.glsl @@ -0,0 +1,15 @@ +varying vec2 varTex0; + +void main() { + vec2 blurCoord = varTex0; + blurCoord.x = varTex0.x + UNI_blurOffset0; + vec3 col = texture2D(UNI_Tex0, blurCoord).rgb; + blurCoord.x = varTex0.x + UNI_blurOffset1; + col += texture2D(UNI_Tex0, blurCoord).rgb; + blurCoord.x = varTex0.x + UNI_blurOffset2; + col += texture2D(UNI_Tex0, blurCoord).rgb; + blurCoord.x = varTex0.x + UNI_blurOffset3; + col += texture2D(UNI_Tex0, blurCoord).rgb; + + gl_FragColor = vec4(col * 0.25, 0.0); //texture2D(UNI_Tex0, varTex0); +} diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/blur_v.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/blur_v.glsl new file mode 100644 index 0000000..a644a3e --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/blur_v.glsl @@ -0,0 +1,17 @@ +varying vec2 varTex0; + +void main() { + vec2 blurCoord = varTex0; + blurCoord.y = varTex0.y + UNI_blurOffset0; + vec3 col = texture2D(UNI_Tex0, blurCoord).rgb; + blurCoord.y = varTex0.y + UNI_blurOffset1; + col += texture2D(UNI_Tex0, blurCoord).rgb; + blurCoord.y = varTex0.y + UNI_blurOffset2; + col += texture2D(UNI_Tex0, blurCoord).rgb; + blurCoord.y = varTex0.y + UNI_blurOffset3; + col += texture2D(UNI_Tex0, blurCoord).rgb; + + col = col * 0.25; + + gl_FragColor = vec4(col, 0.0); //texture2D(UNI_Tex0, varTex0); +} diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/blur_vertex.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/blur_vertex.glsl new file mode 100644 index 0000000..bc824b6 --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/blur_vertex.glsl @@ -0,0 +1,7 @@ +varying vec2 varTex0; + +void main() { + gl_Position = ATTRIB_position; + varTex0 = ATTRIB_texture0; +} + diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl new file mode 100644 index 0000000..5d8938b --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl @@ -0,0 +1,19 @@ +varying vec3 varWorldPos; +varying vec3 varWorldNormal; +varying vec2 varTex0; + +void main() { + + vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz); + vec3 worldNorm = (varWorldNormal); + + vec3 light0Vec = V; + vec3 light0R = reflect(light0Vec, worldNorm); + float light0_Diffuse = dot(worldNorm, light0Vec); + + vec2 t0 = varTex0.xy; + lowp vec4 col = texture2D(UNI_Tex0, t0).rgba; + col.xyz = col.xyz * light0_Diffuse * 1.2; + gl_FragColor = col; //vec4(0.0, 1.0, 0.0, 0.0); +} + diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/metal.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/metal.glsl new file mode 100644 index 0000000..51f0612 --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/metal.glsl @@ -0,0 +1,23 @@ +varying vec3 varWorldPos; +varying vec3 varWorldNormal; +varying vec2 varTex0; + +void main() { + + vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz); + vec3 worldNorm = normalize(varWorldNormal); + + vec3 light0Vec = V; + vec3 light0R = reflect(light0Vec, worldNorm); + float light0_Diffuse = clamp(dot(worldNorm, light0Vec), 0.0, 1.0); + float light0Spec = clamp(dot(-light0R, V), 0.001, 1.0); + float light0_Specular = pow(light0Spec, 15.0) * 0.5; + + vec2 t0 = varTex0.xy; + lowp vec4 col = texture2D(UNI_Tex0, t0).rgba; + col.xyz = col.xyz * (textureCube(UNI_Tex1, worldNorm).rgb * 0.5 + vec3(light0_Diffuse)); + col.xyz += light0_Specular * vec3(0.8, 0.8, 1.0); + + gl_FragColor = col; +} + diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/paintf.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/paintf.glsl new file mode 100644 index 0000000..893d553 --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/paintf.glsl @@ -0,0 +1,26 @@ +varying vec3 varWorldPos; +varying vec3 varWorldNormal; +varying vec2 varTex0; + +void main() { + + vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz); + vec3 worldNorm = normalize(varWorldNormal); + + vec3 light0Vec = V; + vec3 light0R = reflect(light0Vec, worldNorm); + float light0_Diffuse = clamp(dot(worldNorm, light0Vec), 0.01, 0.99); + float light0Spec = clamp(dot(-light0R, V), 0.001, 1.0); + float light0_Specular = pow(light0Spec, 150.0) * 0.5; + + vec2 t0 = varTex0.xy; + lowp vec4 col = texture2D(UNI_Tex0, t0).rgba; + col.xyz = col.xyz * light0_Diffuse * 1.1; + col.xyz += light0_Specular * vec3(0.8, 0.8, 1.0); + + float fresnel = mix(pow(1.0 - light0_Diffuse, 15.0), 1.0, 0.1); + col.xyz = mix(col.xyz, textureCube(UNI_Tex1, -light0R).rgb * 2.4, fresnel); + col.w = 0.8; + gl_FragColor = col; +} + diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/plastic.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/plastic.glsl new file mode 100644 index 0000000..ceb53bd --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/plastic.glsl @@ -0,0 +1,22 @@ +varying vec3 varWorldPos; +varying vec3 varWorldNormal; +varying vec2 varTex0; + +void main() { + + vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz); + vec3 worldNorm = normalize(varWorldNormal); + + vec3 light0Vec = V; + vec3 light0R = reflect(light0Vec, worldNorm); + float light0_Diffuse = clamp(dot(worldNorm, light0Vec), 0.0, 1.0); + float light0Spec = clamp(dot(-light0R, V), 0.001, 1.0); + float light0_Specular = pow(light0Spec, 10.0) * 0.5; + + vec2 t0 = varTex0.xy; + lowp vec4 col = texture2D(UNI_Tex0, t0).rgba; + col.xyz = col.xyz * light0_Diffuse * 1.2; + col.xyz += light0_Specular * vec3(0.8, 0.8, 1.0); + gl_FragColor = col; +} + diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/robot.a3d b/tests/RenderScriptTests/SceneGraph/res/raw/robot.a3d Binary files differnew file mode 100644 index 0000000..f48895c --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/robot.a3d diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/select_color.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/select_color.glsl new file mode 100644 index 0000000..59a267b --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/select_color.glsl @@ -0,0 +1,13 @@ +varying vec2 varTex0; + +void main() { + vec3 col = texture2D(UNI_Tex0, varTex0).rgb; + + vec3 desat = vec3(0.299, 0.587, 0.114); + float lum = dot(desat, col); + float stepVal = step(lum, 0.8); + col = mix(col, vec3(0.0), stepVal)*0.8; + + gl_FragColor = vec4(col, 0.0); +} + diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl new file mode 100644 index 0000000..1ea234f --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/shader2v.glsl @@ -0,0 +1,17 @@ +varying vec3 varWorldPos; +varying vec3 varWorldNormal; +varying vec2 varTex0; + +// This is where actual shader code begins +void main() { + vec4 objPos = ATTRIB_position; + vec4 worldPos = UNI_model * objPos; + gl_Position = UNI_viewProj * worldPos; + + mat3 model3 = mat3(UNI_model[0].xyz, UNI_model[1].xyz, UNI_model[2].xyz); + vec3 worldNorm = model3 * ATTRIB_normal; + + varWorldPos = worldPos.xyz; + varWorldNormal = worldNorm; + varTex0 = ATTRIB_texture0; +} diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/texture.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/texture.glsl new file mode 100644 index 0000000..dd709cf --- /dev/null +++ b/tests/RenderScriptTests/SceneGraph/res/raw/texture.glsl @@ -0,0 +1,7 @@ +varying vec2 varTex0; + +void main() { + lowp vec4 col = texture2D(UNI_Tex0, varTex0).rgba; + gl_FragColor = col; +} + |