Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes

  • Loading branch information...
commit 710a5cc05da106d75fcf2773e583e5b8443ca66f 1 parent 6634933
Erik Faye-Lund kusma authored
Showing with 13 additions and 11 deletions.
  1. +1 −5 data/postprocess.fx
  2. +12 −6 src/main.cpp
6 data/postprocess.fx
View
@@ -51,7 +51,6 @@ sampler overlay_samp = sampler_state {
struct VS_OUTPUT {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
- float2 nuv : TEXCOORD1;
};
VS_OUTPUT vertex(float4 ipos : POSITION, float2 uv : TEXCOORD0)
@@ -59,14 +58,11 @@ VS_OUTPUT vertex(float4 ipos : POSITION, float2 uv : TEXCOORD0)
VS_OUTPUT Out;
Out.pos = ipos;
Out.uv = uv;
- Out.nuv = uv * nscale + noffs;
return Out;
}
float4 pixel(VS_OUTPUT In) : COLOR
{
-// return float4(tex2Dlod(color_samp, float4(In.uv, 0, 0)).rgb, 1);
-
const float sep = 0.03;
float dist = pow(2 * distance(In.uv, float2(0.5, 0.5)), 2);
float2 pos = In.uv;
@@ -101,7 +97,7 @@ float4 pixel(VS_OUTPUT In) : COLOR
col = col * fade + flash;
- col += (tex2D(noise_samp, In.nuv) - 0.5) * (1.0 / 8);
+ col += (tex2D(noise_samp, In.uv * nscale + noffs) - 0.5) * (1.0 / 8);
return float4(col, 1);
}
18 src/main.cpp
View
@@ -270,7 +270,7 @@ int main(int /*argc*/, char* /*argv*/ [])
Texture noise_tex = engine::loadTexture(device, "data/noise.png");
postprocess_fx->setTexture("noise_tex", noise_tex);
- postprocess_fx->setVector3("nscale", Vector3(letterbox_viewport.Width / 128.0, letterbox_viewport.Height / 128.0, 0.0f));
+ postprocess_fx->setVector3("nscale", Vector3(letterbox_viewport.Width / 256.0f, letterbox_viewport.Height / 256.0f, 0.0f));
Texture spectrum_tex = engine::loadTexture(device, "data/spectrum.png");
postprocess_fx->setTexture("spectrum_tex", spectrum_tex);
@@ -352,6 +352,10 @@ int main(int /*argc*/, char* /*argv*/ [])
camTarget = Vector3(0, 0, 0);
}
+ bool cluster = false;
+ bool rooms = true;
+ bool particles = true;
+
double shake_phase = beat * 32 * sync_get_val(cameraShakeSpeedTrack, row);
Vector3 camOffs(sin(shake_phase), cos(shake_phase * 0.9), sin(shake_phase - 0.5));
camPos += camOffs * sync_get_val(cameraShakeAmtTrack, row);
@@ -378,11 +382,13 @@ int main(int /*argc*/, char* /*argv*/ [])
float fog_density = sync_get_val(fogDensityTrack, row) / 100000;
Vector3 worldLightPosition = Vector3(0, sin(beat * 0.25) * 100, 0);
- Vector3 viewLightPosition = mul(view, worldLightPosition);
- cube_room_fx->setVector3("viewLightPosition", viewLightPosition);
- if (0) {
+ if (rooms) {
// cube rooms
+
+ Vector3 viewLightPosition = mul(view, worldLightPosition);
+ cube_room_fx->setVector3("viewLightPosition", viewLightPosition);
+
for (int i = -1; i < 2; ++i)
for (int j = -1; j < 2; ++j) {
Matrix4x4 world = Matrix4x4::translation(Vector3(i * 120, 0, j * 120));
@@ -393,7 +399,7 @@ int main(int /*argc*/, char* /*argv*/ [])
}
}
- if (1) {
+ if (cluster) {
// neuron cluster
neuron_cluster_fx->setFloat("time", beat / 4);
neuron_cluster_fx->setMatrices(world, view, proj);
@@ -405,7 +411,7 @@ int main(int /*argc*/, char* /*argv*/ [])
neuron_cluster_skybox_fx->draw(neuron_cluster_skybox_x);
}
- if (1) {
+ if (particles) {
// particles
Matrix4x4 modelview = world * view;
Vector3 up(modelview._12, modelview._22, modelview._32);
Please sign in to comment.
Something went wrong with that request. Please try again.