Page 1 of 1

Shadows! :D

Posted: Fri Aug 12, 2011 7:03 pm
by Flashbang232
I do not know if anything was updated while I was gone, but I have finally got my shadows right! :D
I think they are improved, I see no visual pixellation/blockiness on Anisotropic filering (set to 0 - no filtering) and it also runs fine, no lag. :)

3do_shadow.frag

Code: Select all

uniform sampler2DShadow shadowMap;
uniform sampler2D       tex0;
varying vec4            light_coord;
varying vec3            normal;

void main()
{
	float fog_coef = clamp( (gl_FogFragCoord - gl_Fog.start) * gl_Fog.scale, 0.0, 1.0 );

    float shaded = shadow2D( shadowMap, light_coord.xyz ).x;
    vec2 test = abs(light_coord.xy - vec2(0.5, 0.5));
    if (test.x > 0.15 || test.y > 0.15)
        shaded = 1.1;

    float diffuse_coef = clamp( dot( normalize(normal), gl_LightSource[0].position.xyz ), 0.0, 1.0 );
    vec4 light_eq = diffuse_coef * shaded + gl_LightModel.ambient;
    vec4 texture_color = texture2D( tex0, gl_TexCoord[0].xy );

    gl_FragColor = vec4(light_eq.rgb, 1.0) * gl_Color * texture_color;
    gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_Fog.color.rgb, fog_coef);
}

3do_shadow.vert

Code: Select all

varying vec4 light_coord;
uniform mat4 light_Projection;
varying vec3 normal;

void main()
{
    gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
	gl_Position = ftransform();
	gl_FrontColor = gl_Color;
    light_coord = light_Projection * (gl_ModelViewMatrix * gl_Vertex);
    gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
	gl_FogFragCoord = gl_Position.z;
	normal = gl_NormalMatrix * gl_Normal;
}
So yeah, Idk exactly how the integer thing goes in this here line:

Code: Select all

if (test.x > 0.15 || test.y > 0.15)
In other words, I assumed a smaller number would be better, so I lessened it down from I believe .5 to .15 and so far ta3d is running good. Shadows look really nice for me B).

EDIT: Going to make an updated version, please stay tuned.....


Im also editing the particles with GIMP.
Pimpin' my ta3d install.
Reminds me of when I screwed up minecraft except that this isn't screwin' up. 8)

Re: Shadows! :D

Posted: Mon Aug 15, 2011 10:09 pm
by zuzuf
Can you post a screen shot :mrgreen: ?

Re: Shadows! :D

Posted: Tue Aug 16, 2011 3:47 pm
by Flashbang232
I don't know the screenshot key. :P
Also, I just updated my version so i cannot. :P
They now look wierd with the new version, i edited the integer to be a ten thousandth of 1, maybe a bit too small ? :)

Thanks Zuzuf.

Also, just did a test, unit control is a bit whack. I selected all my peewees on The Desert Triad to move around a hill, they kept frozen until I clicked for the sixtieth time :P.
Unit queue is a BIT wierd, dont remember naming all my peewees to category "1" :O

SHADOWS :idea:

Particles look better. No more giant green circles :P

Whats up with the shading ? 0o

Re: Shadows! :D

Posted: Tue Aug 16, 2011 9:11 pm
by zuzuf
Use the console: "screenshot()" will do the job.

Re: Shadows! :D

Posted: Thu Aug 18, 2011 12:32 pm
by Balthazar
Screenshot ))) screenshot ))) !!

Re: Shadows! :D

Posted: Sat Aug 20, 2011 6:49 pm
by Flashbang232
I do not know how, still a noob at handling ta3d.
Can I just upload the particle? I am still working on the shadows. 8)
oh well. Im uploading.

here you go.

http://www.fileswap.com/dl/l9wbz1/part.tga.html

it even has glowy outer layer and shine effect! look at it zoomed in!
If you use LCD look at it sideways :3
It turns purple.

Won't be able to bug fix some more ta3d until I get my mouse situation fixed, this damned touchpad is freaking on me so sorry if ther is any typos.