Skip to content

Commit

Permalink
party-version: too many hacks, too little time
Browse files Browse the repository at this point in the history
  • Loading branch information
kusma committed Jul 18, 2012
1 parent b01b9bc commit 9b4cad4
Show file tree
Hide file tree
Showing 33 changed files with 2,332 additions and 184 deletions.
60 changes: 60 additions & 0 deletions data/blur.fx
@@ -0,0 +1,60 @@
const float4 gauss[8];
const int size;

texture blur_tex;
sampler tex = sampler_state {
Texture = (blur_tex);
MipFilter = POINT;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
sRGBTexture = FALSE;
};

struct VS_OUTPUT {
float4 pos : POSITION;
float2 tex : TEXCOORD0;
};

VS_OUTPUT vertex(float4 pos : POSITION, float2 tex : TEXCOORD0)
{
VS_OUTPUT o;
o.pos = pos;
o.tex = tex;
return o;
}

float4 pixel(VS_OUTPUT In) : COLOR
{
float4 c = tex2D(tex, In.tex) * gauss[0].z;
for (int i = 1; i < size; i++) {
c += tex2D(tex, In.tex + gauss[i].xy) * gauss[i].z;
c += tex2D(tex, In.tex - gauss[i].xy) * gauss[i].z;
}
return c;
}

technique blur {
pass P0 {
VertexShader = compile vs_2_0 vertex();
PixelShader = compile ps_2_0 pixel();
}
}

float3 rgbe_to_rgb(float4 rgbe)
{
return rgbe.rgb * exp2(rgbe.a * 255 - 128);
}

float4 pixel2(VS_OUTPUT In) : COLOR
{
return float4(rgbe_to_rgb(tex2D(tex, In.tex)), 1.0);
}

technique hack {
pass P0 {
VertexShader = compile vs_2_0 vertex();
PixelShader = compile ps_2_0 pixel2();
}
}
Binary file modified data/darksmoke.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0009.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0010.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0011.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0012.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0013.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0014.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0015.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/kockamaps/0016.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0001.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0002.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0003.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0004.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0005.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0006.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0007.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0008.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0009.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0010.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0011.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0012.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0013.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0014.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0015.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0016.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/overlays/0017.png
Binary file added data/overlays/0018.png
Binary file added data/overlays/0019.png
37 changes: 27 additions & 10 deletions data/particle.fx
Expand Up @@ -15,15 +15,13 @@ sampler tex_samp = sampler_state {
sRGBTexture = FALSE; sRGBTexture = FALSE;
}; };


struct VS_INPUT struct VS_INPUT {
{
float3 pos : POSITION; float3 pos : POSITION;
float size : TEXCOORD0; float size : TEXCOORD0;
float2 uv : TEXCOORD1; float2 uv : TEXCOORD1;
}; };


struct VS_OUTPUT struct VS_OUTPUT {
{
float4 pos : POSITION; float4 pos : POSITION;
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
float alpha : TEXCOORD1; float alpha : TEXCOORD1;
Expand All @@ -40,15 +38,34 @@ VS_OUTPUT vertex(VS_INPUT In)
return Out; return Out;
} }


float4 pixel(VS_OUTPUT In) : COLOR float4 black_pixel(VS_OUTPUT In) : COLOR
{
return float4(0, 0, 0, tex2D(tex_samp, In.uv).a) * In.alpha * alpha;
}

float4 white_pixel(VS_OUTPUT In) : COLOR
{ {
float4 col = tex2D(tex_samp, In.uv); return float4(1, 1, 1, tex2D(tex_samp, In.uv).a) * In.alpha * alpha;
return float4(col.rgb * In.alpha * alpha, col.a * In.alpha * alpha); }

technique black {
pass P0 {
VertexShader = compile vs_3_0 vertex();
PixelShader = compile ps_3_0 black_pixel();
AlphaBlendEnable = True;
ZWriteEnable = False;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
}
} }


technique fx { technique white {
pass P0 { pass P0 {
VertexShader = compile vs_2_0 vertex(); VertexShader = compile vs_3_0 vertex();
PixelShader = compile ps_2_0 pixel(); PixelShader = compile ps_3_0 white_pixel();
AlphaBlendEnable = True;
ZWriteEnable = False;
SrcBlend = SrcAlpha;
DestBlend = One;
} }
} }
14 changes: 14 additions & 0 deletions data/postprocess.fx
Expand Up @@ -4,6 +4,7 @@ const float noise_amt;
const float dist_amt, dist_freq, dist_time; const float dist_amt, dist_freq, dist_time;
const float2 viewport; const float2 viewport;
const float color_map_lerp; const float color_map_lerp;
const float bloom_amt;


texture color_tex; texture color_tex;
sampler color_samp = sampler_state { sampler color_samp = sampler_state {
Expand All @@ -16,6 +17,17 @@ sampler color_samp = sampler_state {
sRGBTexture = FALSE; sRGBTexture = FALSE;
}; };


texture bloom_tex;
sampler bloom_samp = sampler_state {
Texture = (bloom_tex);
MipFilter = NONE;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
sRGBTexture = FALSE;
};

texture spectrum_tex; texture spectrum_tex;
sampler spectrum_samp = sampler_state { sampler spectrum_samp = sampler_state {
Texture = (spectrum_tex); Texture = (spectrum_tex);
Expand Down Expand Up @@ -124,6 +136,8 @@ float4 pixel(VS_OUTPUT In) : COLOR
float3 col = sqrt(sum); float3 col = sqrt(sum);
#endif #endif


col += tex2D(bloom_samp, In.uv) * bloom_amt;

float4 o = tex2D(overlay_samp, In.uv); float4 o = tex2D(overlay_samp, In.uv);
o.a *= overlay_alpha; o.a *= overlay_alpha;
col *= 1 - o.a; col *= 1 - o.a;
Expand Down

0 comments on commit 9b4cad4

Please sign in to comment.