Skip to content
Snippets Groups Projects
Commit 65cffc84 authored by dg's avatar dg
Browse files

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@1404 51575b47-30f0-44d4-a5cc-537603b46e54
parent 8274a5d1
No related branches found
No related tags found
No related merge requests found
......@@ -448,9 +448,7 @@ function _M:display()
self.level.map:display(0, 0)
self.target:display(0, 0)
self.fbo:use(false)
-- local time = 1 + math.floor(core.game.getTime() / 50) % 500
-- _2DNoise[time]:bind(1, false)
_3DNoise:bind(1, true)
_2DNoise:bind(1, false)
self.fbo:toScreen(
self.level.map.display_x, self.level.map.display_y,
self.level.map.viewport.width, self.level.map.viewport.height,
......
......@@ -2,7 +2,7 @@ uniform float hp_warning;
uniform float motionblur;
uniform float blur;
uniform float tick;
uniform sampler3D noisevol;
uniform sampler2D noisevol;
uniform vec2 texSize;
uniform sampler2D tex;
uniform vec3 colorize;
......@@ -14,14 +14,14 @@ void main(void)
if (motionblur > 0.0)
{
int blursize = int(motionblur);
vec2 offset = 1.0/texSize;
float fTime0_X = tick / 40000.0;
vec2 coord = gl_TexCoord[0].xy;
float noisy = texture3D(noisevol,vec3(coord,fTime0_X)).r;
// float noisy2 = texture3D(noisevol,vec3(coord/5.0,fTime0_X)).r;
// float noisy3 = texture3D(noisevol,vec3(coord/7.0,fTime0_X)).r;
// float noise = (noisy+noisy2+noisy3)/3.0;
vec2 offset = 0.8/texSize;
float fTime0_X = tick / 20000.0;
float coord = gl_TexCoord[0].x + gl_TexCoord[0].y * texSize[0];
float noisy1 = texture2D(noisevol,vec2(coord,fTime0_X)).r;
float noisy2 = texture2D(noisevol,vec2(coord/5.0,fTime0_X/1.5)).r;
float noisy3 = texture2D(noisevol,vec2(coord/7.0,fTime0_X/2)).r;
float noisy = (noisy1+noisy2+noisy3)/3.0;
// Center Pixel
vec4 sample = vec4(0.0,0.0,0.0,0.0);
......
......@@ -45,8 +45,10 @@ profile.mod.allow_build = profile.mod.allow_build or {}
-- Create some noise textures
local n = core.noise.new(3)
_3DNoise = n:makeTexture3D(64, 64, 64)
local n = core.noise.new(3)
_2DNoise = n:makeTexture2DStack(64, 64, 64)
local n = core.noise.new(2)
_2DNoise = n:makeTexture2D(64, 64)
--local n = core.noise.new(3)
--_2DNoise = n:makeTexture2DStack(64, 64, 64)
-- Achievements
WorldAchievements:loadDefinition("/data/achievements/")
......
......@@ -261,7 +261,6 @@ static int noise_texture3d(lua_State *L)
for (k = 0; k < d; k++)
{
float v = tilablenoise3d(n, i*4, j*4, k*4, w*4, h*4, d*4) * 255;
if (!i && !j) printf("!!!!plop ! %d : %f\n", k, v);
map[TEXEL3(i, j, k)] = (GLubyte)v;
map[TEXEL3(i, j, k)+1] = (GLubyte)v;
map[TEXEL3(i, j, k)+2] = (GLubyte)v;
......@@ -341,7 +340,6 @@ static int noise_texture2dstack(lua_State *L)
for (j = 0; j < h; j++)
{
float v = tilablenoise3d(n, i*4, j*4, k*4, w*4, h*4, d*4) * 255;
if (!i && !j) printf("plop ! %d : %f\n", k, v);
map[TEXEL2(i, j)] = (GLubyte)v;
map[TEXEL2(i, j)+1] = (GLubyte)v;
map[TEXEL2(i, j)+2] = (GLubyte)v;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment