Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 19 Jul 2011
Offline Last Active Today, 08:51 AM

Posts I've Made

In Topic: [Help] Sprite animation

24 March 2015 - 08:31 PM

Using a timer in the main loop who compute the time to render one frame like I said.

This time is then used in all time based calcule to be independent of the framerate.

Example :

  ElapsedTime = Timer.GetTimeSeconds();

Then in your update of the sprite animation :

CurrentTime += ElapsedTime * Speed;

In Topic: [Help] Sprite animation

24 March 2015 - 08:52 AM

I never used app game kit so I don't know how the scripting really work but to keep the same speed in all framerate you have to use the elapsed time from the last frame.

Maybe you must use sprite animation from app game kit directly : http://www.appgamekit.com/documentation/examples/sprites/7_anim2.htm

Have you tried this stuff ?

In Topic: [Help] Sprite animation

23 March 2015 - 10:25 PM

tick = tick + 1

You should do :

tick += ElapsedTime * Speed

ElapsedTime is the time from the previous image, using it you will have the animation the same speed in all frame rate.

In Topic: Outline fragment shader

22 March 2015 - 09:11 PM

You can achieve this effect in 2 steps :

1) Render outline geometry in a stencil buffer, use a render targer and output an ID on each object pixel (unique ID).

2) Test a box of pixel of the size you want and check if it's an outline, you know it's an outline if the ID is not the same on the whole box.

If it's an outline output a pixel color which is your outline color. Blend the result using alpha blending, or discard on the second step.


EDIT : Apparently this is the kind of algorithm you already use.

In Topic: Projected Decals Stretching

22 March 2015 - 09:06 PM

To avoid this effect in my deferred decal I do a normal gradient :

float4 DecalNormal = mul( float4( GBufferBData.rgb, 0.0f ), DecalMatrix );
DecalTexCoord.xy -= DecalTexCoord.z * DecalNormal.xy;