Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 749 vs 750 for /trunk/assets/shaders/GLSL/fragmentAtoms/utility.frag

Diff revisions: vs.
  @@ -21,6 +21,25 @@
21 21 targetTexture.xyz = mix(targetTexture.xyz, projectedTex.xyz, projectedTextureMixWeight);
22 22 }
23 23
24 + //Box Projected Cube Environment Mapping by Bartosz Czuba
25 + vec3 bpcem(in vec3 v, vec3 Emax, vec3 Emin, vec3 Epos)
26 + {
27 + vec3 pos = vec3(1.0);
28 + //e.g.: vec3 rVec = bpcem(reflect(vVec,nVec),EnvBoxMax,EnvBoxMin,EnvBoxPos); //bpcem-izing reflection coordinates
29 + // vec3 env = textureCube(envMap, rVec).rgb;
30 + vec3 nrdir = normalize(v);
31 + vec3 rbmax = (Emax - pos) / nrdir;
32 + vec3 rbmin = (Emin - pos) / nrdir;
33 +
34 + vec3 rbminmax;
35 + rbminmax.x = (nrdir.x>0.0) ? rbmax.x : rbmin.x;
36 + rbminmax.y = (nrdir.y>0.0) ? rbmax.y : rbmin.y;
37 + rbminmax.z = (nrdir.z>0.0) ? rbmax.z : rbmin.z;
38 + float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);
39 + vec3 posonbox = pos + nrdir * fa;
40 + return posonbox - Epos;
41 + }
42 +
24 43 vec3 applyFogColour(in vec3 colour){
25 44 const float LOG2 = 1.442695;
26 45 float zDepth = gl_FragCoord.z / gl_FragCoord.w;