edit:please go to ta3d directory \scripts\ta3d.lh
looks like a code that controls how ta3d uses ta scripts or something. I see familiar ta-bos script commands.
Is this it? Because I remember matman said that the script animations were buggy.
also, i think i found the files that control water animation.
Code: Select all
varying vec2 t_coord;
varying vec3 dir;
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
t_coord = vec2(gl_TextureMatrix[0] * gl_MultiTexCoord0);
dir = (gl_ModelViewMatrixInverse[3] - gl_Vertex ).xyz;
}
[/ta3d/shaders]
*bigger wall of code*
Code: Select all
varying vec2 t_coord;
varying vec3 dir;
uniform float t;
uniform vec2 factor;
uniform sampler2D lava;
uniform sampler2D map;
vec3 wave_grad( vec2 d, float p, float type )
{
vec2 base_grad = 2.0 * texture2D( map, vec2( dot( d, t_coord ) + p, type ) ).xy - vec2( 1.0, 1.0 );
vec3 grad = vec3( d.x * base_grad.x, base_grad.y, d.y * base_grad.x );
return normalize( grad );
}
void main()
{
vec3 N = wave_grad( vec2( 65.0, 15.1 ), 0.15 * t, 0.8 )
+ wave_grad( vec2( 19.7, -33.1 ), 0.21 * t, 0.3 )
+ wave_grad( vec2( -27.0, 23.3 ), 0.13 * t, 0.45 )
+ wave_grad( vec2( 77.0, -130.3 ), 0.13 * t, 0.65 )
+ wave_grad( vec2( 97.0, 87.1 ), 0.17 * t, 0.77 );
N=normalize(N);
vec2 lava_coord = (t_coord-vec2(0.5,0.5))*factor+vec2(0.5,0.5);
float lava_c = 0.5 * texture2D(lava,lava_coord).r + 0.5;
if (lava_coord.x < 0.0 || lava_coord.y < 0.0 || lava_coord.x > 1.0 || lava_coord.y > 1.0)
lava_c = 0.0;
gl_FragColor = vec4(0.5*(N+vec3(1.0,1.0,1.0)),lava_c);
}
i notice that some of this is similar to the LUA scripting style....are these types of scripting/coding connected somehow?
Water "Simulator" [water_simulator2.frag]
Code: Select all
varying vec2 t_coord;
uniform float dt;
uniform sampler2D sim;
const vec2 du = vec2(0.00390625, 0.0);
const vec2 dv = vec2(0.0, 0.00390625);
void main()
{
vec4 P0 = texture2DLod( sim, t_coord, 0.0 );
vec4 PU = texture2DLod( sim, t_coord - du, 0.0 );
vec4 PV = texture2DLod( sim, t_coord - dv, 0.0 );
P0.y += dt * (P0.x + P0.z - PU.x - PV.z);
gl_FragColor = P0;
}
well it isnt unacceptable but we can surely do without.
Now, I am going on a tutorial hunt.
I hope im not breaking forum rules somehow.