port from perforce
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
uniform sampler2D texture2d_1;
|
||||
/* uniform sampler1D texture_transfer_function;
|
||||
uniform sampler1D texture_palette_function;
|
||||
|
||||
|
||||
uniform float3 VolumeSize;
|
||||
uniform float3 RelativeSize;
|
||||
uniform float3 Registration_Offset;
|
||||
uniform float pet_alpha_blending;
|
||||
uniform float3 MousePos;
|
||||
uniform int Projection_mode;
|
||||
uniform float3 InVolumePosition;
|
||||
uniform float3 Windowing_Levels;
|
||||
|
||||
uniform float isosurface;
|
||||
uniform float Sharpening;
|
||||
|
||||
*/
|
||||
|
||||
uniform float Limit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
|
||||
|
||||
float4 cl;
|
||||
cl=vec4 (0.0);
|
||||
int count=0;
|
||||
|
||||
// loop, highlight speculars (>0.9)
|
||||
for (int y=-8;y<9;y++) {
|
||||
for (int x=-8;x<9;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*1.02;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
float2 Dist=dd*0.0015;
|
||||
float4 res=tex2D(texture2d_1,oUV.xy+Dist);
|
||||
//res*=res;
|
||||
//if (res.w<0.9) {res*=res*0.35+0.05; }
|
||||
cl+=res;
|
||||
}
|
||||
}
|
||||
cl/=float (count);
|
||||
|
||||
|
||||
|
||||
//cl=tex2D(texture2d_1,oUV.xy)*vec4 (1.0,0.0,0.0,1.0)+vec4 (0.2,0.0,0.0,0.0);
|
||||
|
||||
//cl*=1.2;
|
||||
//cl+=float4 (0.0,0.02,0.05,1);
|
||||
//cl=vec4 (0.0);
|
||||
|
||||
|
||||
//cl=tex2D(texture2d_1,oUV.xy)*1.0;
|
||||
|
||||
/*
|
||||
//Depth blurring
|
||||
|
||||
float dpth=0;
|
||||
int count=0;
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*0.7;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
|
||||
float2 Dist=dd*0.0015;
|
||||
dpth+=tex2D(texture2d_2,UV.xy+Dist).x;
|
||||
}
|
||||
}
|
||||
dpth/=float (count);
|
||||
//dpth=sin(dpth*3.14159);
|
||||
dpth+=0.1;
|
||||
dpth=pow(dpth,6.0);
|
||||
//dpth+=Limit;
|
||||
dpth=1.1-dpth;
|
||||
//if (dpth<0.7) dpth=0.0;
|
||||
count=0;
|
||||
cl=vec4(0.0);
|
||||
dpth=clamp(dpth,0.0,1.0);
|
||||
|
||||
dpth=Limit+((1.0-Limit)-(Limit))*dpth;
|
||||
|
||||
if (dpth>0.02) {
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y);
|
||||
|
||||
//if ( (x)==(y)) { dd*=120.0;}
|
||||
|
||||
float2 Dist=dd*0.0015*dpth;
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
}
|
||||
}
|
||||
|
||||
cl/=float (count);
|
||||
}
|
||||
else
|
||||
cl=tex2D(texture2d_1,UV.xy);
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gl_FragData[0]=cl;
|
||||
gl_FragData[1]=cl;
|
||||
|
||||
/*
|
||||
float3 currentuv;
|
||||
|
||||
|
||||
|
||||
if (Projection_mode==0) {
|
||||
currentuv.xy=oUV.st;
|
||||
currentuv.z=0.0+InVolumePosition.z;
|
||||
}
|
||||
else
|
||||
if (Projection_mode==1) {
|
||||
currentuv.xz=oUV.st;
|
||||
currentuv.y=0.0+InVolumePosition.y;
|
||||
}
|
||||
else
|
||||
if (Projection_mode==2) {
|
||||
currentuv.zy=oUV.ts;
|
||||
currentuv.x=0.0+InVolumePosition.x;
|
||||
}
|
||||
float4 original= tex3D (texture3d,currentuv);
|
||||
float divisor=1.0/(Windowing_Levels.y-Windowing_Levels.x);
|
||||
|
||||
|
||||
|
||||
|
||||
original-=Windowing_Levels.x*float4 (1,1,1,1);
|
||||
original*=divisor;
|
||||
|
||||
|
||||
//original.x=max (0.0,min (1.0,original.x));
|
||||
|
||||
|
||||
gl_FragColor=currentuv.xyzz;
|
||||
//gl_FragColor=float4 (1.0,0.0,0.0,1.0);
|
||||
//gl_FragColor*=Sharpening;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,498 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
uniform sampler2D texture2d_1;
|
||||
uniform sampler2D texture2d_s;
|
||||
uniform sampler2D texture2d_velocities;
|
||||
uniform sampler2D texture2d_2;
|
||||
uniform sampler2D texture2d_random;
|
||||
/* uniform sampler1D texture_transfer_function;
|
||||
uniform sampler1D texture_palette_function;
|
||||
|
||||
|
||||
uniform float3 VolumeSize;
|
||||
uniform float3 RelativeSize;
|
||||
uniform float3 Registration_Offset;
|
||||
uniform float pet_alpha_blending;
|
||||
uniform float3 MousePos;
|
||||
uniform int Projection_mode;
|
||||
uniform float3 InVolumePosition;
|
||||
uniform float3 Windowing_Levels;
|
||||
|
||||
uniform float isosurface;
|
||||
uniform float Sharpening;
|
||||
|
||||
*/
|
||||
|
||||
uniform float Limit;
|
||||
uniform float Flo;
|
||||
|
||||
uniform float PosY;
|
||||
uniform float ttime;
|
||||
uniform float fttime;
|
||||
uniform float DSP;
|
||||
uniform float DSP2;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
//float ff=tex2D (texture2d_1,oUV.xy).x;
|
||||
//ff=abs (ff-cl.x);
|
||||
//ff=0.5+0.5*sin(ff*10000.0);
|
||||
//cl=ff*vec4 (1.0);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
float PI=3.1415926535;
|
||||
float2 UV=oUV.xy;
|
||||
|
||||
UV-=float2 (0.5,0.5);
|
||||
UV*=2.0;
|
||||
|
||||
|
||||
float3 DirV =float3 (UV.x,UV.y,0.6);
|
||||
float lgn=length (DirV);
|
||||
DirV/=lgn;
|
||||
|
||||
UV.xy=UV.xy+(DirV.xy-UV.xy)*-0.0;
|
||||
UV*=0.5;
|
||||
UV+=float2 (0.5,0.5);
|
||||
*/
|
||||
float2 UV=oUV.xy;
|
||||
float4 cl=tex2D (texture2d_1,UV.xy);
|
||||
|
||||
cl=float4 (0.0);
|
||||
float3 Direction=tex2D (texture2d_velocities,UV.xy).xyz;
|
||||
//Direction.xy=float2 (0.5);
|
||||
Direction.xyz-=float3 (0.5);
|
||||
Direction*=2.0;
|
||||
|
||||
float alpha=1.0*length (Direction.xyz);
|
||||
alpha=clamp (alpha,0.0,1.0);
|
||||
//alpha=1-alpha;
|
||||
//alpha*=alpha;
|
||||
//alpha=1-alpha;
|
||||
|
||||
//alpha*=alpha;
|
||||
//alpha=0.1;
|
||||
//Direction*=0.01;
|
||||
//Direction=vec3 (0.0,0.01,0.0);
|
||||
if (alpha>0.01)
|
||||
{
|
||||
for (int t=0;t<10;t++) {
|
||||
UV.xy-=Direction.xy*0.01;
|
||||
cl+=tex2D (texture2d_1,UV.xy);
|
||||
};
|
||||
|
||||
cl*=1.0/10.0;
|
||||
//Direction=tex2D (texture2d_velocities,UV.xy).xyz;
|
||||
//cl=Direction.xyzz*1.0+vec4 (0.5);
|
||||
//cl.x+=0.15*alpha;
|
||||
//=float4 (1.0,0.0,0.0,1.0)*alpha;
|
||||
}
|
||||
else cl=tex2D (texture2d_1,UV.xy);
|
||||
|
||||
//float4 clnow=tex2D( texture2d_1,oUV.xy);
|
||||
//cl=cl+(clnow-cl)*0.5;
|
||||
|
||||
UV=oUV.xy;
|
||||
if (fttime>186.0) if (fttime<242.0) if (UV.x>0.5) UV.x=1.0-UV.x;
|
||||
|
||||
float fx=tex2D (texture2d_1,UV.xy).x;
|
||||
|
||||
|
||||
if (ttime>169.0)
|
||||
if (ttime<184.0){
|
||||
|
||||
if (UV.y>0.5) UV.y=1.0-UV.y;
|
||||
}
|
||||
|
||||
if (ttime<197.0)
|
||||
if (ttime>184.0){
|
||||
if (UV.x>0.5) UV.x=1.0-UV.x;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (ttime<86.0)
|
||||
if (ttime>26.5)
|
||||
if (UV.x>0.5) UV.x=1.0-UV.x;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (ttime>98.0)
|
||||
if (ttime<106.0) {
|
||||
|
||||
float fft=((UV.x-0.5) / (UV.y-0.5));
|
||||
fft=1.0*atan (fft);
|
||||
|
||||
//fft=mod (fft,1.4);
|
||||
|
||||
|
||||
float dist=length (UV.xy-vec2 (0.5));
|
||||
|
||||
vec2 UVn;
|
||||
UVn.x=dist * sin(fft)+0.5;
|
||||
UVn.y=dist * cos(fft)+0.5;
|
||||
|
||||
UV=UVn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//1.0-UV.x;
|
||||
|
||||
|
||||
//if (UV.y>0.5) UV.y=1.0-UV.y;
|
||||
//if (UV.x>fx) UV.x=1.0-UV.x;
|
||||
//+(fx-0.5);
|
||||
cl=1.0*tex2D (texture2d_1,UV.xy);
|
||||
cl+=1.0*tex2D (texture2d_s,UV.xy);
|
||||
|
||||
vec4 cln=cl;
|
||||
|
||||
if ((ttime>86.0) && (ttime<104.0)){
|
||||
|
||||
|
||||
float cll2=cl.y;
|
||||
// if (UV.y>0.8) UV.y=1.0-UV.y+0.6;
|
||||
|
||||
cl=1.0*tex2D (texture2d_1,UV.xy);
|
||||
cl+=1.0*tex2D (texture2d_s,UV.xy);
|
||||
|
||||
vec4 cln=vec4(tex2D(texture2d_1,UV.xy).x)+vec4(tex2D(texture2d_s,UV.xy).x);
|
||||
if (cll2>0.9) cl*=100.0;
|
||||
//vec4 (1.7,0.8,1.0,0.0);
|
||||
float fl=(ttime-92.0)*0.125;
|
||||
fl=clamp (fl,0.0,1.0);
|
||||
cl=cl+(cln-cl)*fl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (ttime>104.0) {
|
||||
|
||||
|
||||
float cll2=cl.y;
|
||||
float cll3=cl.z;
|
||||
|
||||
float fl2=(ttime-123.0)*0.25;
|
||||
|
||||
fl2=clamp (fl2,0.0,1.0);
|
||||
fl2=0.0;
|
||||
float ff=UV.x;
|
||||
|
||||
if (fttime<186.0)
|
||||
if (UV.x>0.5+fl2) UV.x=1.0-UV.x;
|
||||
|
||||
//UV.x=UV.x+(ff-UV.x)*fl2;
|
||||
|
||||
|
||||
|
||||
|
||||
cl=vec4(tex2D(texture2d_1,UV.xy).x)+vec4(tex2D(texture2d_s,UV.xy).x);
|
||||
if (cll2>0.9)
|
||||
cl*=1.7*vec4 (0.7,0.8,1.0,0.0);
|
||||
|
||||
fl2=(ttime-131.0)*0.3;
|
||||
|
||||
if (fttime>186.0);
|
||||
fl2=(ttime-129.0)*0.25;
|
||||
|
||||
fl2=clamp (fl2,0.0,1.0);
|
||||
cl=cl+(cln-cl)*fl2;
|
||||
//if (cll3>0.6) cl*=1.7*vec4 (0.7,0.9,1.0,0.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cl+=vec4(DSP*DSP*oUV.y)*0.25;
|
||||
|
||||
|
||||
float flx=1.9;
|
||||
if (ttime>140.0) flx=1.2;
|
||||
|
||||
|
||||
if (cl.z>flx)
|
||||
{
|
||||
float ures=pow(sin(UV.x*5.0),5.0);
|
||||
if (ures>0.5) ures=-1.0; else ures=1.0;
|
||||
float uu=pow(1.1*sin(5.0*ttime+2000.0*UV.x)*sin(2000.0*UV.y),8.0);
|
||||
uu*=pow(1.1*sin(ures*-15.0*ttime+200.0*UV.x)*sin(ures*-10.0*ttime+200.0*UV.y),8.0);
|
||||
|
||||
if (uu>0.0)
|
||||
cl*=0.0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (ttime<250.0)
|
||||
if (length (cl)<0.1) {
|
||||
float ures=pow(sin(UV.x*15.0),5.0);
|
||||
if (ures>0.5) ures=-1.0; else ures=1.0;
|
||||
float uu=pow(1.1*sin(5.0*ttime+2000.0*UV.x)*sin(2000.0*UV.y),8.0);
|
||||
uu*=pow(1.1*sin(ures*-5.0*ttime+400.0*UV.x)*sin(ures*-10.0*ttime+400.0*UV.y),8.0);
|
||||
|
||||
|
||||
float fl2=(ttime-32.0)*0.125;
|
||||
fl2=clamp (fl2,0.0,1.0);
|
||||
|
||||
if (uu>0.04)
|
||||
cl+=fl2*vec4 (0.43)*vec4 (0.7,1.0,1.0,1.0)*pow((1.0-oUV.y),2.0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
if (ttime>230.0)
|
||||
if (sin(oUV.y*100.0)>0.0)
|
||||
cl=vec4 (cl.x);
|
||||
*/
|
||||
|
||||
|
||||
float ffade=ttime-230.0;
|
||||
ffade=clamp (ffade,0.0,1.0);
|
||||
if (fttime>230.0)
|
||||
cl*=ffade;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//cl*=0.5+DSP2;
|
||||
|
||||
|
||||
float fls=
|
||||
min (length (vec2 (2.0,0.5)*(oUV.xy-vec2 (0.5,0.4))),
|
||||
length (vec2 (0.5,2.0)*(oUV.xy-vec2 (0.5,0.4))));
|
||||
fls=1.0-fls;
|
||||
fls=clamp (fls,0.0,1.0);
|
||||
fls=pow (fls,2.0);
|
||||
//float fls2=length (oUV.xy-vec2 (0.5));
|
||||
|
||||
fls=
|
||||
length (vec2 (2.0,0.5)*(oUV.xy-vec2 (0.5,0.4)));
|
||||
fls=1.0-fls;
|
||||
fls=clamp (fls,0.0,1.0);
|
||||
fls=pow (fls,3.0);
|
||||
//fls*=clamp (10.0*sin(oUV.y*1200.0),0.0,1.0);
|
||||
|
||||
|
||||
if (fttime<130.0)
|
||||
cl*=1.0+2.0*DSP2*fls*vec4 (0.5,0.7,1.0,1.0);
|
||||
|
||||
if (fttime>190.0)
|
||||
cl*=1.0+2.0*DSP2*fls*vec4 (0.5,0.7,1.0,1.0);
|
||||
|
||||
|
||||
|
||||
//fls=(oUV.x-0.5)+(oUV.y-0.5);
|
||||
//fls=1.0-fls;
|
||||
//cl*=1.0+1.5*vec4 (0.6,0.8,0.9,1.0)*5.0*vec4 (pow(fls,8.0));
|
||||
//cl=tex2D (texture2d_1,vec2 (sin(oUV.x),sin(oUV.y)));
|
||||
|
||||
|
||||
vec4 clnn=vec4 (pow (cl.x*1.1,3.0),pow (cl.y*1.1,3.0),pow (cl.z*1.1,3.0),pow (cl.z*1.1,2.0));
|
||||
|
||||
|
||||
|
||||
if (ttime>86.0)
|
||||
cl=vec4 (cl.x)+(clnn-vec4 (cl.x))*0.3;
|
||||
else
|
||||
cl=vec4 (cl.y)+(0.8*clnn-vec4 (cl.y))*0.25;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//cl=clnn;
|
||||
|
||||
|
||||
|
||||
|
||||
//*vec4 (0.2,0.5,1.0,1.0);
|
||||
|
||||
|
||||
//cl=vec4(tex2D(texture2d_1,UV.xy).x)+vec4(tex2D(texture2d_s,UV.xy).x);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
// blur effect
|
||||
float lgn2=length (float2 (1.0,2.0)*(UV.xy-float2 (0.5)));
|
||||
lgn2*=lgn2;
|
||||
//pow(lgn2,1.8);
|
||||
int count=0;
|
||||
for (int y=-5;y<6;y++) {
|
||||
for (int x=-5;x<6;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y);
|
||||
if ( (x)==(y)) {
|
||||
dd*=2.0;
|
||||
}
|
||||
|
||||
float2 Dist=float2 (x,y)*0.0025*lgn2;
|
||||
Dist=dd*0.0025*lgn2;
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
|
||||
}
|
||||
}
|
||||
cl/=float (count)*(lgn2+(1.0-lgn2)*0.85);
|
||||
|
||||
|
||||
vec4 cll=cl;
|
||||
|
||||
cl=tex2D (texture2d_1,oUV.xy);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Depth blurring
|
||||
|
||||
float dpth=0.0;
|
||||
count=0;
|
||||
float Limit2=1.0-Limit;
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*0.7*Limit2;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
|
||||
float2 Dist=dd*0.0018;
|
||||
dpth+=tex2D(texture2d_2,UV.xy+Dist).x;
|
||||
}
|
||||
}
|
||||
dpth/=float (count);
|
||||
//dpth=sin(dpth*3.14159);
|
||||
//dpth+=0.1;
|
||||
dpth=pow(dpth,126.0);
|
||||
//dpth+=Limit;
|
||||
dpth=1.0-1.0*dpth;
|
||||
//if (dpth<0.7) dpth=0.0;
|
||||
count=0;
|
||||
cl=vec4(0.0);
|
||||
dpth=clamp(dpth,0.0,1.0);
|
||||
|
||||
dpth=Limit+((1.0-Limit)-(Limit))*dpth;
|
||||
dpth*=Flo;
|
||||
//dpth=1.0;
|
||||
|
||||
float vel=tex2D(texture2d_velocities,UV.xy).x;
|
||||
if (dpth>0.02)
|
||||
{
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y)*0.7;//;*vec2 (3.0,3.0);
|
||||
|
||||
//float2 dd2=float((x+4)*9+(y+4))*float2 (-1.0,1.0)*0.4;
|
||||
//dd=dd+(dd2-dd)*-vel*0.4;
|
||||
|
||||
|
||||
float2 Dist=dd*0.0018*dpth;
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
//cl.x=dpth;
|
||||
}
|
||||
}
|
||||
|
||||
cl/=float (count);
|
||||
}
|
||||
else
|
||||
cl=tex2D(texture2d_1,UV.xy);
|
||||
|
||||
|
||||
|
||||
if (vel>0.01) {
|
||||
vec4 newcl=vec4 (0.0);
|
||||
for (int x=0;x<15;x++){
|
||||
float2 dd2=float(x)*float2 (-1.0,1.0)*0.003*vel;
|
||||
newcl+=tex2D(texture2d_1,UV.xy+dd2);
|
||||
}
|
||||
newcl*=1.0/15.0;
|
||||
|
||||
cl=cl+(newcl-cl)*0.5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//cl*=0.4;
|
||||
|
||||
//cl+=tex2D(texture2d_velocities,UV.xy)*0.5;
|
||||
|
||||
|
||||
//cl=tex2D(texture2d_1,UV.xy);
|
||||
//cl=vec4 (dpth);
|
||||
*/
|
||||
|
||||
//cl=vec4 (tex2D(texture2d_1,UV.xy));
|
||||
//cl=vec4 (tex2D(texture2d_velocities,UV.xy));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//cl=cll;
|
||||
|
||||
|
||||
|
||||
gl_FragData[0]=cl;
|
||||
gl_FragData[1]=cl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
uniform sampler2D texture2d_1;
|
||||
uniform sampler2D texture2d_velocities;
|
||||
uniform sampler2D texture2d_2;
|
||||
uniform sampler2D texture2d_random;
|
||||
/* uniform sampler1D texture_transfer_function;
|
||||
uniform sampler1D texture_palette_function;
|
||||
|
||||
|
||||
uniform float3 VolumeSize;
|
||||
uniform float3 RelativeSize;
|
||||
uniform float3 Registration_Offset;
|
||||
uniform float pet_alpha_blending;
|
||||
uniform float3 MousePos;
|
||||
uniform int Projection_mode;
|
||||
uniform float3 InVolumePosition;
|
||||
uniform float3 Windowing_Levels;
|
||||
|
||||
uniform float isosurface;
|
||||
uniform float Sharpening;
|
||||
|
||||
*/
|
||||
|
||||
uniform float Limit;
|
||||
uniform float Flo;
|
||||
|
||||
uniform float PosY;
|
||||
uniform vec3 MotionBlur;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
vec2 MotionBlurPos=vec2 (0.0,0.0);
|
||||
|
||||
|
||||
|
||||
//float ff=tex2D (texture2d_1,oUV.xy).x;
|
||||
//ff=abs (ff-cl.x);
|
||||
//ff=0.5+0.5*sin(ff*10000.0);
|
||||
//cl=ff*vec4 (1.0);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
float PI=3.1415926535;
|
||||
float2 UV=oUV.xy;
|
||||
|
||||
UV-=float2 (0.5,0.5);
|
||||
UV*=2.0;
|
||||
|
||||
|
||||
float3 DirV =float3 (UV.x,UV.y,0.6);
|
||||
float lgn=length (DirV);
|
||||
DirV/=lgn;
|
||||
|
||||
UV.xy=UV.xy+(DirV.xy-UV.xy)*-0.0;
|
||||
UV*=0.5;
|
||||
UV+=float2 (0.5,0.5);
|
||||
*/
|
||||
float2 UV=oUV.xy;
|
||||
float4 cl=tex2D (texture2d_1,UV.xy);
|
||||
|
||||
cl=float4 (0.0);
|
||||
float3 Direction=tex2D (texture2d_velocities,UV.xy).xyz;
|
||||
//Direction.xy=float2 (0.5);
|
||||
Direction.xyz-=float3 (0.5);
|
||||
Direction*=2.0;
|
||||
|
||||
float alpha=1.0*length (Direction.xyz);
|
||||
alpha=clamp (alpha,0.0,1.0);
|
||||
//alpha=1-alpha;
|
||||
//alpha*=alpha;
|
||||
//alpha=1-alpha;
|
||||
|
||||
//alpha*=alpha;
|
||||
//alpha=0.1;
|
||||
Direction*=0.01;
|
||||
if (alpha>0.01)
|
||||
{
|
||||
for (int t=0;t<10;t++) {
|
||||
UV.xy-=Direction.xy;
|
||||
cl+=tex2D (texture2d_1,UV.xy);
|
||||
};
|
||||
cl*=1.0/10.0;
|
||||
//cl.x+=0.15*alpha;
|
||||
//=float4 (1.0,0.0,0.0,1.0)*alpha;
|
||||
}
|
||||
else
|
||||
cl=tex2D (texture2d_1,UV.xy);
|
||||
|
||||
float4 clnow=tex2D( texture2d_1,oUV.xy);
|
||||
|
||||
cl=cl+(clnow-cl)*0.5;
|
||||
|
||||
UV=oUV.xy;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// blur effect
|
||||
float lgn2=length (float2 (1.0,2.0)*(UV.xy-float2 (0.5)));
|
||||
lgn2*=lgn2;
|
||||
float xxx=1.0+(gl_Color.x)*5.0;
|
||||
//xxx=1.0;
|
||||
xxx=clamp (xxx,1.0,100.0);
|
||||
//pow(lgn2,1.8);
|
||||
int count=0;
|
||||
{
|
||||
for (int y=-3;y<3;y++) {
|
||||
for (int x=-3;x<3;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y);
|
||||
if ( (x)==(y)) {
|
||||
//dd*=2.0;
|
||||
}
|
||||
|
||||
float2 Dist=float2 (x,y)*0.0025*lgn2;
|
||||
Dist=dd*0.0018*lgn2*xxx;
|
||||
|
||||
Dist+=MotionBlurPos;
|
||||
MotionBlurPos+=MotionBlur.xy*0.01;
|
||||
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
|
||||
}
|
||||
}
|
||||
cl/=float (count)*(lgn2+(1.0-lgn2)*0.85);
|
||||
}
|
||||
|
||||
vec4 cll=cl*1.03;
|
||||
cll+=gl_Color;
|
||||
//cll=tex2D (texture2d_1,oUV.xy);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
|
||||
//Depth blurring
|
||||
|
||||
float dpth=0.0;
|
||||
count=0;
|
||||
float Limit2=1.0-Limit;
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*0.7*Limit2;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
|
||||
float2 Dist=dd*0.0018;
|
||||
dpth+=tex2D(texture2d_2,UV.xy+Dist).x;
|
||||
}
|
||||
}
|
||||
dpth/=float (count);
|
||||
//dpth=sin(dpth*3.14159);
|
||||
//dpth+=0.1;
|
||||
dpth=pow(dpth,126.0);
|
||||
//dpth+=Limit;
|
||||
dpth=1.0-1.0*dpth;
|
||||
//if (dpth<0.7) dpth=0.0;
|
||||
count=0;
|
||||
cl=vec4(0.0);
|
||||
dpth=clamp(dpth,0.0,1.0);
|
||||
|
||||
dpth=Limit+((1.0-Limit)-(Limit))*dpth;
|
||||
dpth*=Flo;
|
||||
//dpth=1.0;
|
||||
|
||||
float vel=tex2D(texture2d_velocities,UV.xy).x;
|
||||
if (dpth>0.02)
|
||||
{
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y)*0.7;//;*vec2 (3.0,3.0);
|
||||
|
||||
//float2 dd2=float((x+4)*9+(y+4))*float2 (-1.0,1.0)*0.4;
|
||||
//dd=dd+(dd2-dd)*-vel*0.4;
|
||||
|
||||
|
||||
float2 Dist=dd*0.0018*dpth;
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
//cl.x=dpth;
|
||||
}
|
||||
}
|
||||
|
||||
cl/=float (count);
|
||||
}
|
||||
else
|
||||
cl=tex2D(texture2d_1,UV.xy);
|
||||
|
||||
|
||||
|
||||
if (vel>0.01) {
|
||||
vec4 newcl=vec4 (0.0);
|
||||
for (int x=0;x<15;x++){
|
||||
float2 dd2=float(x)*float2 (-1.0,1.0)*0.003*vel;
|
||||
newcl+=tex2D(texture2d_1,UV.xy+dd2);
|
||||
}
|
||||
newcl*=1.0/15.0;
|
||||
|
||||
cl=cl+(newcl-cl)*0.5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//cl*=0.4;
|
||||
|
||||
//cl+=tex2D(texture2d_velocities,UV.xy)*0.5;
|
||||
|
||||
|
||||
//cl=tex2D(texture2d_1,UV.xy);
|
||||
//cl=vec4 (dpth);
|
||||
|
||||
//cl=vec4 (tex2D(texture2d_2,UV.xy).x);
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
cl=cll;
|
||||
|
||||
|
||||
|
||||
gl_FragData[0]=cl;
|
||||
gl_FragData[1]=cl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,316 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
#define SSAO se= ep+ddd*sign (dot (ray,norm))*ray; \
|
||||
occluderFragment = tex2D(texture2d_1,se.xy); \
|
||||
shadow=occluderFragment.w;\
|
||||
occluderFragment.a=tex2D (texture2d_2,se.xy).x;\
|
||||
occNorm = (occluderFragment.xyz*2.0)-vec3 (1.0);\
|
||||
depthDifference = depth-occluderFragment.a;\
|
||||
normDiff = 1.0-1.0*dot(occNorm,norm);\
|
||||
addition=step(0.00002,depthDifference)*normDiff*(1.0-smoothstep(0.000002,0.20,depthDifference));\
|
||||
bl += addition;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uniform sampler2D texture2d_1;
|
||||
uniform sampler2D texture2d_2;
|
||||
uniform sampler2D texture2d_3;
|
||||
uniform sampler2D texture2d_projected;
|
||||
uniform sampler2D texture2d_random;
|
||||
uniform float Limit;
|
||||
uniform float fttime;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float4 cl;
|
||||
float depth;
|
||||
|
||||
|
||||
|
||||
// random vector
|
||||
vec3 fres = normalize((texture2D(texture2d_random,oUV.xy*2.0+float2 (Limit*1.0)).xyz*2.0) - vec3(1.0));
|
||||
|
||||
// depth
|
||||
depth=tex2D (texture2d_2,oUV.xy).x;
|
||||
|
||||
vec3 ep=vec3 (oUV.xy,depth);
|
||||
float bl=0.0;
|
||||
vec3 ray;
|
||||
vec3 se;
|
||||
vec3 occNorm;
|
||||
float depthDifference,normDiff;
|
||||
float3 norm=((tex2D (texture2d_1,oUV.xy).xyz-0.5)*2.0);
|
||||
float4 GlobalIllumination=float4 (0.0);
|
||||
bl=1.0;
|
||||
|
||||
|
||||
|
||||
float ddd=0.002;
|
||||
float shadow;
|
||||
float addition;
|
||||
vec4 occluderFragment;
|
||||
|
||||
//for (int i=0;i<24;i++)
|
||||
|
||||
bool occluder;
|
||||
occluder=true;
|
||||
//if (tex2D(texture2d_1,oUV.xy).w<0.9) occluder=false;
|
||||
|
||||
if (occluder) {
|
||||
|
||||
|
||||
//1
|
||||
ray= reflect (vec3(0.53812504, 0.18565957, -0.43192),fres);
|
||||
SSAO
|
||||
//2
|
||||
ray= reflect (vec3(0.13790712, 0.24864247, 0.44301823),fres);
|
||||
SSAO
|
||||
//3
|
||||
ray= reflect (vec3(0.33715037, 0.56794053, -0.005789503),fres);
|
||||
SSAO
|
||||
//4
|
||||
ray= reflect ( vec3(-0.6999805, -0.04511441, -0.0019965635),fres);
|
||||
SSAO
|
||||
//5
|
||||
ray= reflect ( vec3(0.06896307, -0.15983082, -0.85477847),fres);
|
||||
SSAO
|
||||
//6
|
||||
ray= reflect (vec3(0.056099437, 0.006954967, -0.1843352),fres);
|
||||
SSAO
|
||||
//7
|
||||
ray= reflect ( vec3(-0.014653638, 0.14027752, 0.0762037),fres);
|
||||
SSAO
|
||||
//8
|
||||
ray= reflect ( vec3(0.010019933, -0.1924225, -0.034443386),fres);
|
||||
SSAO
|
||||
//9
|
||||
ray= reflect ( vec3(-0.35775623, -0.5301969, -0.43581226),fres);
|
||||
SSAO
|
||||
//10
|
||||
ray= reflect ( vec3(-0.3169221, 0.106360726, 0.015860917),fres);
|
||||
SSAO
|
||||
//11
|
||||
ray= reflect ( vec3(0.010350345, -0.58698344, 0.0046293875),fres);
|
||||
SSAO
|
||||
//12
|
||||
|
||||
ray= reflect ( vec3(-0.08972908, -0.49408212, 0.3287904),fres);
|
||||
SSAO
|
||||
//13
|
||||
ray= reflect ( vec3(0.7119986, -0.0154690035, -0.09183723),fres);
|
||||
SSAO
|
||||
//14
|
||||
ray= reflect ( vec3(-0.053382345, 0.059675813, -0.5411899),fres);
|
||||
SSAO
|
||||
//15
|
||||
ray= reflect ( vec3(0.035267662, -0.063188605, 0.54602677),fres);
|
||||
SSAO
|
||||
//16
|
||||
/*
|
||||
ray= reflect ( vec3(-0.47761092, 0.2847911, -0.0271716),fres);
|
||||
SSAO
|
||||
//17
|
||||
ray= reflect ( vec3 ( -0.559644, -0.554896, -0.61554),fres);
|
||||
SSAO
|
||||
//18
|
||||
ray= reflect (vec3 ( 0.65487, 0.496541, -0.569729),fres);
|
||||
SSAO
|
||||
//19
|
||||
ray= reflect (vec3 ( 0.382319, -0.719566, 0.579705),fres);
|
||||
SSAO
|
||||
//20
|
||||
ray= reflect ( vec3 ( 0.800123, 0.344357, 0.491142),fres);
|
||||
SSAO
|
||||
//21
|
||||
ray= reflect ( vec3 ( 0.426191, -0.414526, 0.804071),fres);
|
||||
SSAO
|
||||
*/
|
||||
|
||||
|
||||
|
||||
bl=1.0-bl*0.09*5.10;
|
||||
//bl=1.0-bl*0.09*0.80;
|
||||
|
||||
|
||||
|
||||
//bl=1.0-clamp (bl,0.0,1.0);
|
||||
//bl*=2.0;
|
||||
//bl+=0.02;
|
||||
}
|
||||
|
||||
//bl=0.0;
|
||||
norm=normalize(norm);
|
||||
// SS lighting
|
||||
float ccl=1.0-0.0*pow(dot (norm,float3 (0.0,0.0,1.0)),2.0);
|
||||
|
||||
// shadow
|
||||
|
||||
//bl=1.0;
|
||||
//bl*=1.0-tex2D(texture2d_1,oUV.xy).w*0.5;
|
||||
|
||||
|
||||
// SS Reflections
|
||||
//float4 NormMot=norm.xyzz;
|
||||
///float2 DiffusedUV=norm.xy*0.025+oUV.xy;
|
||||
///float4 Refl=2.5*tex2D (texture2d_3,DiffusedUV);
|
||||
|
||||
|
||||
gl_FragData[0]=bl*ccl*tex2D(texture2d_3,oUV.xy);
|
||||
|
||||
gl_FragData[0]=tex2D(texture2d_1,oUV.xy);
|
||||
gl_FragData[1]=tex2D(texture2d_3,oUV.xy);
|
||||
|
||||
|
||||
int count=0;
|
||||
vec4 Comp=vec4 (0.0);
|
||||
vec4 Comp2=vec4 (0.0);
|
||||
for (int y=-3;y<4;y++) {
|
||||
for (int x=-3;x<4;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*0.0005+oUV.xy;
|
||||
Comp+=tex2D (texture2d_1,dd);
|
||||
}
|
||||
}
|
||||
|
||||
Comp/=float (count);
|
||||
Comp2/=float (count);
|
||||
vec4 ResDP=tex2D (texture2d_1,oUV.xy);
|
||||
|
||||
Comp*=2.0;
|
||||
Comp-=vec4 (1.0);
|
||||
|
||||
ResDP*=2.0;
|
||||
ResDP-=vec4 (1.0);
|
||||
|
||||
|
||||
float dt=1.0*length (Comp.xyz-ResDP.xyz);
|
||||
dt=4.0+3.8*(1.0-max (dt,1.0*(abs(dot (Comp,ResDP)))));
|
||||
//dt=10.0*(max (dt,(abs(dot (Comp,ResDP)))));
|
||||
//dt=0.2*abs(dot (Comp,ResDP));
|
||||
//dt=(3.0+3.0*(abs(dot (Comp,ResDP))));
|
||||
//dt=1.0;
|
||||
//dt=1.0;
|
||||
dt+=0.4;
|
||||
|
||||
gl_FragData[0]=tex2D (texture2d_3,oUV.xy)*1.0*vec4 (dt);
|
||||
|
||||
// fogging
|
||||
gl_FragData[0]*=1.0-vec4 (pow (tex2D (texture2d_2,oUV.xy).x,30.0));
|
||||
|
||||
if (fttime>260.0)
|
||||
gl_FragData[0]=tex2D (texture2d_3,oUV.xy);
|
||||
|
||||
|
||||
//if (sin (oUV.y*1100.0)<0.0) gl_FragData[0]*=2.8*vec4 (0.6,0.6,0.6,0.6);
|
||||
//if (sin (oUV.x*1200.0)<0.0) gl_FragData[0]*=vec4 (1.0,0.6,0.6,0.6);
|
||||
//if (int(oUV.y*100.0)%2==0) gl_FragData[0]=vec4 (0.0);
|
||||
|
||||
//gl_FragData[0]+=1.3*vec4 (pow(tex2D (texture2d_3,oUV.xy).x,3.0));
|
||||
|
||||
//gl_FragData[0]*=0.3;
|
||||
//tex2D (texture2d_3,oUV.xy);
|
||||
|
||||
|
||||
//dt=10.0*length (Comp.xyz-ResDP.xyz);
|
||||
//gl_FragData[0]=vec4 (dt);
|
||||
|
||||
//gl_FragData[0]=tex2D (texture2d_3,oUV.xy);
|
||||
//gl_FragData[0]=vec4 (dt);
|
||||
//gl_FragData[0]=tex2D (texture2d_3,oUV.xy)*vec4 (bl);
|
||||
|
||||
//gl_FragData[0]=vec4(bl)*tex2D(texture2d_3,oUV.xy)+0.0*vec4 (0.0,0.05,0.1,0.0);;
|
||||
|
||||
/*
|
||||
if (oUV.y<0.5)
|
||||
{
|
||||
if (oUV.x>0.5)
|
||||
gl_FragData[0]=tex2D(texture2d_3,vec2 (1.0-oUV.x,oUV.y));
|
||||
else
|
||||
gl_FragData[0]=tex2D(texture2d_3,oUV.xy);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (oUV.x>0.5)
|
||||
gl_FragData[0]=tex2D(texture2d_3,vec2 (1.0-oUV.x,1.0-oUV.y));
|
||||
else
|
||||
gl_FragData[0]=tex2D(texture2d_3,vec2 (oUV.x,1.0-oUV.y));
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
float ff=0.5*3.1515926535+atan ((oUV.x-0.5)/(oUV.y-0.5));
|
||||
ff=sin (0.5*ff);
|
||||
float fd=length (oUV.xy-vec2 (0.5));
|
||||
///ff*=2.0;
|
||||
//ff*=0.1;
|
||||
vec2 Res=fd*vec2 (sin(ff),cos(ff));
|
||||
|
||||
gl_FragData[0]=tex2D (texture2d_3,Res);
|
||||
//0.5+0.5*vec4(ff);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//gl_FragData[0]=tex2D(texture2d_3,oUV.xy)*1.2;
|
||||
|
||||
//gl_FragData[0]=5.0*vec4 (pow(tex2D(texture2d_2,oUV.xy).x-0.7,4.0));
|
||||
//gl_FragData[0]=vec4(bl)*0.2+0.1*tex2D(texture2d_2,oUV.xy);
|
||||
|
||||
//gl_FragData[0]=vec4(bl);
|
||||
/*
|
||||
if (occluder)
|
||||
gl_FragData[0]=vec4(1.0);
|
||||
else
|
||||
gl_FragData[0]=vec4(0.0);
|
||||
*/
|
||||
|
||||
// Highlights
|
||||
//if (tex2D (texture2d_1,oUV.xy).w>0.9) gl_FragData[0]=tex2D (texture2d_3,oUV.xy);
|
||||
//gl_FragData[0].w=tex2D (texture2d_1,oUV.xy).w;
|
||||
|
||||
//gl_FragData[1]=tex2D(texture2d_3,oUV.xy);
|
||||
|
||||
//gl_FragData[0]=tex2D (texture2d_2,oUV.xy);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
uniform sampler2D texture2d_1;
|
||||
/* uniform sampler1D texture_transfer_function;
|
||||
uniform sampler1D texture_palette_function;
|
||||
|
||||
|
||||
uniform float3 VolumeSize;
|
||||
uniform float3 RelativeSize;
|
||||
uniform float3 Registration_Offset;
|
||||
uniform float pet_alpha_blending;
|
||||
uniform float3 MousePos;
|
||||
uniform int Projection_mode;
|
||||
uniform float3 InVolumePosition;
|
||||
uniform float3 Windowing_Levels;
|
||||
|
||||
uniform float isosurface;
|
||||
uniform float Sharpening;
|
||||
|
||||
*/
|
||||
|
||||
uniform float Limit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
float v=0.102;
|
||||
|
||||
float dss=1.0-pow(length(oUV.xy-float2 (0.5,0.5)),1.0);
|
||||
float2 dirr=float2 (0.5,0.5);
|
||||
//dss=1;
|
||||
//dss*=1.5;
|
||||
|
||||
v*=dss*dss;
|
||||
//v=0.002;
|
||||
float2 MX=float2 (v,0.0);
|
||||
float2 MU=float2 (0.0,v);
|
||||
dirr.y*=1.0;
|
||||
vec4 cl=float4 (0.0);
|
||||
/*
|
||||
for (int t=0;t<7;t++) {
|
||||
float ff=float (t)/(20.0f);
|
||||
// cl+=0.11*(1-ff)*tex2D (texture2d_1,ff*dirr+(1-ff)*oUV.st);
|
||||
cl+=0.19*(1-ff)*tex2D (texture2d_1,ff*dirr+(1-ff)*oUV.st);
|
||||
|
||||
}
|
||||
|
||||
0.05,0.1,0.15,0.2,0.25,0.3
|
||||
*/
|
||||
//float cl=0.3;
|
||||
float4 sti=tex2D (texture2d_1,oUV.st);
|
||||
cl+=0.191*tex2D (texture2d_1,oUV.st);
|
||||
|
||||
cl+=0.191*(0.95)*tex2D (texture2d_1,0.93*0.075*dirr+(1.0-0.93*0.075)*oUV.st);
|
||||
cl+=0.191*(0.9)*tex2D (texture2d_1,0.93*0.15*dirr+(1.0-0.93*0.015)*oUV.st);
|
||||
cl+=0.191*(0.85)*tex2D (texture2d_1,0.93*0.225*dirr+(1.0-0.93*0.225)*oUV.st);
|
||||
|
||||
cl+=0.191*(0.8)*tex2D (texture2d_1,0.93*0.300*dirr+(1.0-0.93*0.300)*oUV.st);
|
||||
cl+=0.191*(0.75)*tex2D (texture2d_1,0.93*0.375*dirr+(1.0-0.93*0.375)*oUV.st);
|
||||
cl+=0.191*(0.7)*tex2D (texture2d_1,0.93*0.450*dirr+(1.0-0.93*0.450)*oUV.st);
|
||||
|
||||
cl=tex2D(texture2d_1,oUV.st)+cl*0.7*float4 (0.4,0.6,1.0,0.0);
|
||||
//cl*=dss*sti;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//float4 cl;
|
||||
//cl=tex2D (texture2d_1,oUV.xy)*1.0*vec4 (0.0,0.0,1.0,0.0);
|
||||
cl=vec4 (0.0);
|
||||
int count=0;
|
||||
float2 DirV=oUV.xy-float2 (0.5,0.5);
|
||||
//DirV=-normalize (DirV);
|
||||
DirV*=-1.0;
|
||||
for (int x=0;x<18;x++){
|
||||
count++;
|
||||
|
||||
float2 Dist=DirV*float(x)*0.05;
|
||||
float4 res=tex2D(texture2d_1,oUV.xy+Dist);
|
||||
res*=res*1.5;
|
||||
//res*=1.0+0.5*sin(oUV.x*12.0);
|
||||
//res*=1.0+0.7*sin(oUV.y*24.0);
|
||||
cl+=res;
|
||||
}
|
||||
|
||||
cl/=float (count);
|
||||
cl=tex2D(texture2d_1,oUV.st)*0.9+cl*3.5;
|
||||
//*float4 (0.4,0.6,1.0,0.0);
|
||||
//cl*=float4 (1.0,1.0,1.0,1.0);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
//Depth blurring
|
||||
|
||||
float dpth=0;
|
||||
int count=0;
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*0.7;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
|
||||
float2 Dist=dd*0.0015;
|
||||
dpth+=tex2D(texture2d_2,UV.xy+Dist).x;
|
||||
}
|
||||
}
|
||||
dpth/=float (count);
|
||||
//dpth=sin(dpth*3.14159);
|
||||
dpth+=0.1;
|
||||
dpth=pow(dpth,6.0);
|
||||
//dpth+=Limit;
|
||||
dpth=1.1-dpth;
|
||||
//if (dpth<0.7) dpth=0.0;
|
||||
count=0;
|
||||
cl=vec4(0.0);
|
||||
dpth=clamp(dpth,0.0,1.0);
|
||||
|
||||
dpth=Limit+((1.0-Limit)-(Limit))*dpth;
|
||||
|
||||
if (dpth>0.02) {
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y);
|
||||
|
||||
//if ( (x)==(y)) { dd*=120.0;}
|
||||
|
||||
float2 Dist=dd*0.0015*dpth;
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
}
|
||||
}
|
||||
|
||||
cl/=float (count);
|
||||
}
|
||||
else
|
||||
cl=tex2D(texture2d_1,UV.xy);
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gl_FragData[0]=cl;
|
||||
gl_FragData[1]=cl;
|
||||
|
||||
/*
|
||||
float3 currentuv;
|
||||
|
||||
|
||||
|
||||
if (Projection_mode==0) {
|
||||
currentuv.xy=oUV.st;
|
||||
currentuv.z=0.0+InVolumePosition.z;
|
||||
}
|
||||
else
|
||||
if (Projection_mode==1) {
|
||||
currentuv.xz=oUV.st;
|
||||
currentuv.y=0.0+InVolumePosition.y;
|
||||
}
|
||||
else
|
||||
if (Projection_mode==2) {
|
||||
currentuv.zy=oUV.ts;
|
||||
currentuv.x=0.0+InVolumePosition.x;
|
||||
}
|
||||
float4 original= tex3D (texture3d,currentuv);
|
||||
float divisor=1.0/(Windowing_Levels.y-Windowing_Levels.x);
|
||||
|
||||
|
||||
|
||||
|
||||
original-=Windowing_Levels.x*float4 (1,1,1,1);
|
||||
original*=divisor;
|
||||
|
||||
|
||||
//original.x=max (0.0,min (1.0,original.x));
|
||||
|
||||
|
||||
gl_FragColor=currentuv.xyzz;
|
||||
//gl_FragColor=float4 (1.0,0.0,0.0,1.0);
|
||||
//gl_FragColor*=Sharpening;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
uniform sampler2D texture2d_1;
|
||||
/* uniform sampler1D texture_transfer_function;
|
||||
uniform sampler1D texture_palette_function;
|
||||
|
||||
|
||||
uniform float3 VolumeSize;
|
||||
uniform float3 RelativeSize;
|
||||
uniform float3 Registration_Offset;
|
||||
uniform float pet_alpha_blending;
|
||||
uniform float3 MousePos;
|
||||
uniform int Projection_mode;
|
||||
uniform float3 InVolumePosition;
|
||||
uniform float3 Windowing_Levels;
|
||||
|
||||
uniform float isosurface;
|
||||
uniform float Sharpening;
|
||||
|
||||
*/
|
||||
|
||||
uniform float Limit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
|
||||
|
||||
float4 cl;
|
||||
//cl=tex2D (texture2d_1,oUV.xy)*1.0*vec4 (0.0,0.0,1.0,0.0);
|
||||
cl=vec4 (0.0);
|
||||
int count=0;
|
||||
for (int y=-6;y<7;y++) {
|
||||
for (int x=-6;x<7;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*1.5;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
float2 Dist=dd*0.15;
|
||||
float4 res=tex2D(texture2d_1,oUV.xy+Dist);
|
||||
cl+=res;
|
||||
}
|
||||
}
|
||||
cl/=float (count);
|
||||
//cl*=0.0;
|
||||
cl=float4 (1.0,0.0,0.0,0.0);
|
||||
|
||||
cl.w=tex2D (texture2d_1,oUV.xy).w;
|
||||
/*
|
||||
//Depth blurring
|
||||
|
||||
float dpth=0;
|
||||
int count=0;
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
float2 dd=float2 (x,y)*0.7;
|
||||
|
||||
//dd=ray.xy*5.0;
|
||||
|
||||
float2 Dist=dd*0.0015;
|
||||
dpth+=tex2D(texture2d_2,UV.xy+Dist).x;
|
||||
}
|
||||
}
|
||||
dpth/=float (count);
|
||||
//dpth=sin(dpth*3.14159);
|
||||
dpth+=0.1;
|
||||
dpth=pow(dpth,6.0);
|
||||
//dpth+=Limit;
|
||||
dpth=1.1-dpth;
|
||||
//if (dpth<0.7) dpth=0.0;
|
||||
count=0;
|
||||
cl=vec4(0.0);
|
||||
dpth=clamp(dpth,0.0,1.0);
|
||||
|
||||
dpth=Limit+((1.0-Limit)-(Limit))*dpth;
|
||||
|
||||
if (dpth>0.02) {
|
||||
for (int y=-4;y<5;y++) {
|
||||
for (int x=-4;x<5;x++){
|
||||
count++;
|
||||
|
||||
float2 dd=float2 (x,y);
|
||||
|
||||
//if ( (x)==(y)) { dd*=120.0;}
|
||||
|
||||
float2 Dist=dd*0.0015*dpth;
|
||||
cl+=tex2D(texture2d_1,UV.xy+Dist);
|
||||
}
|
||||
}
|
||||
|
||||
cl/=float (count);
|
||||
}
|
||||
else
|
||||
cl=tex2D(texture2d_1,UV.xy);
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gl_FragData[0]=cl;
|
||||
gl_FragData[1]=cl;
|
||||
|
||||
/*
|
||||
float3 currentuv;
|
||||
|
||||
|
||||
|
||||
if (Projection_mode==0) {
|
||||
currentuv.xy=oUV.st;
|
||||
currentuv.z=0.0+InVolumePosition.z;
|
||||
}
|
||||
else
|
||||
if (Projection_mode==1) {
|
||||
currentuv.xz=oUV.st;
|
||||
currentuv.y=0.0+InVolumePosition.y;
|
||||
}
|
||||
else
|
||||
if (Projection_mode==2) {
|
||||
currentuv.zy=oUV.ts;
|
||||
currentuv.x=0.0+InVolumePosition.x;
|
||||
}
|
||||
float4 original= tex3D (texture3d,currentuv);
|
||||
float divisor=1.0/(Windowing_Levels.y-Windowing_Levels.x);
|
||||
|
||||
|
||||
|
||||
|
||||
original-=Windowing_Levels.x*float4 (1,1,1,1);
|
||||
original*=divisor;
|
||||
|
||||
|
||||
//original.x=max (0.0,min (1.0,original.x));
|
||||
|
||||
|
||||
gl_FragColor=currentuv.xyzz;
|
||||
//gl_FragColor=float4 (1.0,0.0,0.0,1.0);
|
||||
//gl_FragColor*=Sharpening;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#version 110
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
#define oUV gl_TexCoord[0]
|
||||
#define tex3D texture3D
|
||||
#define tex2D texture2D
|
||||
#define tex1D texture1D
|
||||
|
||||
varying vec3 normal;
|
||||
varying vec4 position;
|
||||
varying vec4 thecolor;
|
||||
|
||||
varying vec2 texture_coordinate_1;
|
||||
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
|
||||
float4 TheNormal=float4 (1.0,0.0,0.0,0.0);
|
||||
//TheNormal.w=shadow;
|
||||
gl_FragData[0]=thecolor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
#define float4 vec4
|
||||
#define float3 vec3
|
||||
#define float2 vec2
|
||||
|
||||
|
||||
|
||||
|
||||
varying vec3 normal;
|
||||
varying vec2 texture_coordinate_1;
|
||||
varying vec4 position;
|
||||
varying vec4 thecolor;
|
||||
|
||||
uniform mat4 ProjectionMatrix;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
mat4 Billboard;
|
||||
|
||||
vec4 glVertex=gl_Vertex;
|
||||
|
||||
vec4 Next_Position;
|
||||
|
||||
//gl_Position = gl_TextureMatrix[0] * gl_Vertex;
|
||||
|
||||
|
||||
float4 MotionBlurPos_current=gl_TextureMatrix[0]*gl_Vertex;
|
||||
float4 MotionBlurPos_previous=gl_TextureMatrix[1]*gl_Vertex;
|
||||
|
||||
|
||||
|
||||
float3 MotionBlurmotionVector=MotionBlurPos_current.xyz-MotionBlurPos_previous.xyz;
|
||||
|
||||
|
||||
float4 MotionBlurNormalDirection=float4 (0.0,0.0,0.0,0.0)-gl_Vertex.xyzz;
|
||||
MotionBlurNormalDirection= -gl_Normal.xyzz*1.0;
|
||||
|
||||
///MotionBlurNormalDirection=gl_TextureMatrix[0]*MotionBlurNormalDirection;
|
||||
// normalize (MotionBlurNormalDirection);
|
||||
|
||||
|
||||
|
||||
float MotionBlurflag=dot (MotionBlurmotionVector.xyz,MotionBlurNormalDirection.xyz);
|
||||
float4 MotionBlurstretch;
|
||||
|
||||
float smm=0.0;
|
||||
if (MotionBlurflag>-0.0)
|
||||
{
|
||||
MotionBlurstretch = MotionBlurPos_current+(MotionBlurPos_previous-MotionBlurPos_current)*1.0;
|
||||
smm=1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
smm=0.3;
|
||||
MotionBlurstretch= MotionBlurPos_current;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//MotionBlurstretch = MotionBlurPos_current+(MotionBlurPos_previous-MotionBlurPos_current)*1.0;
|
||||
|
||||
|
||||
|
||||
|
||||
//MotionBlurPos_current.xyz=MotionBlurPos_current.xyz/MotionBlurPos_current.w;
|
||||
//MotionBlurstretch.xyz=MotionBlurstretch.xyz/MotionBlurstretch.w;
|
||||
//MotionBlurstretch=MotionBlurPos_previous;
|
||||
gl_Position = gl_ModelViewProjectionMatrix* MotionBlurstretch;
|
||||
|
||||
float3 MotionBlur_dP=MotionBlurstretch.xyz-MotionBlurPos_current.xyz;
|
||||
|
||||
float4 Mot=MotionBlur_dP.xyzz;
|
||||
Mot=gl_ModelViewProjectionMatrix*Mot;
|
||||
MotionBlur_dP.xyz=Mot.xyz;
|
||||
|
||||
MotionBlur_dP+=float3 (1.0);
|
||||
MotionBlur_dP*=0.5;
|
||||
|
||||
|
||||
thecolor =MotionBlur_dP.xyzz;
|
||||
//thecolor =MotionBlurNormalDirection.xyzz;
|
||||
//thecolor=float4 (smm);
|
||||
//thecolor=(MotionBlurPos_previous-MotionBlurPos_current).xyzz+float4 (0.5,0.5,0.5,0.5);
|
||||
//thecolor=gl_TextureMatrix[0]*gl_Normal.xyzz;
|
||||
//gl_Position= gl_ModelViewProjectionMatrix*gl_TextureMatrix[0]*gl_Vertex;
|
||||
|
||||
//thecolor=MotionBlurstretch.xyzz;
|
||||
|
||||
|
||||
// Transforming The Normal To ModelView-Space
|
||||
// normal = gl_NormalMatrix * gl_Normal;
|
||||
//normal = gl_Normal;
|
||||
//texture_coordinate_1 = vec2(gl_MultiTexCoord0);
|
||||
|
||||
//position=(glVertex).xyzw;
|
||||
//ShadowPosZ= ProjectionMatrix * gl_TextureMatrix[0]*gl_Vertex;
|
||||
//position=g
|
||||
// Transforming The Vertex Position To ModelView-Space
|
||||
// vec4 vertex_in_modelview_space = gl_ModelViewMatrx * gl_Vertex;
|
||||
|
||||
// Calculating The Vector From The Vertex Position To The Light Position
|
||||
// vertex_to_light_vector = vec3(gl_LightSource[0].position – vertex_in_modelview_space);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user