git-svn-id: svn://db.shs.com.ru/libs@67 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -50,8 +50,8 @@ void main(void) {
|
||||
vec3 speed = pos.xyz/pos.w - ppos.xyz/ppos.w;
|
||||
//speed /= abs(pos.z);
|
||||
|
||||
gl_FragDepth = logz;
|
||||
qgl_FragData[0] = vec4(dc.rgb, pos.z);
|
||||
//gl_FragDepth = logz;
|
||||
qgl_FragData[0] = vec4(dc.rgb, pos.w);
|
||||
qgl_FragData[1] = vec4(n.xyz / 2. + vec3(0.5), specularity);
|
||||
qgl_FragData[2] = vec4(spec.rgb, hei);
|
||||
qgl_FragData[3] = vec4(self.rgb, bn.x);
|
||||
|
||||
@@ -134,7 +134,7 @@ void main(void) {
|
||||
calcLight(0, n, v, v2);
|
||||
|
||||
qgl_FragData[0].rgb = li * dc + si * v2.rgb + v3.rgb + texelFetch(t_pp, tc, 0).rgb;
|
||||
//qgl_FragData[0].rgb = vec3(vds2.x*1);
|
||||
//qgl_FragData[0].rgb = vec3(abs((v0.w)/50));
|
||||
//qgl_FragData[0].rgb = li + vec3(texelFetch(t_pp, tc, 0).xyz);
|
||||
//shd = shd - shp.w;
|
||||
|
||||
|
||||
17
qglview/shaders/ssr.frag
Normal file
17
qglview/shaders/ssr.frag
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D t0, t1, ts;
|
||||
uniform float z_near, z_far;
|
||||
|
||||
void main(void) {
|
||||
ivec2 tc = ivec2(gl_FragCoord.xy);
|
||||
vec2 sp = qgl_FragTexture.xy;
|
||||
vec4 v0 = texelFetch(t0, tc, 0), v1 = texelFetch(t1, tc, 0), vs = texelFetch(ts, tc, 0);
|
||||
vec3 dc = v0.rgb, n = v1.xyz * 2. - vec3(1.);
|
||||
vec3 vd = vec3(0, 0, 1);
|
||||
vec3 rn = reflect(vd, n);
|
||||
float coeff = clamp(dot(vd, rn), 0, 1);
|
||||
vec3 rvs = texture(ts, sp - rn.xy/v0.w).rgb;
|
||||
qgl_FragData[0].rgb = mix(vs.rgb, rvs, coeff);
|
||||
//qgl_FragData[0].rgb = vec3(v0.w/10);
|
||||
}
|
||||
6
qglview/shaders/ssr.vert
Normal file
6
qglview/shaders/ssr.vert
Normal file
@@ -0,0 +1,6 @@
|
||||
#version 150
|
||||
|
||||
void main(void) {
|
||||
qgl_FragTexture = qgl_Texture;
|
||||
gl_Position = qgl_ftransform();
|
||||
}
|
||||
Reference in New Issue
Block a user