Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 07 Feb 2010
Offline Last Active Today, 12:10 AM

Posts I've Made

In Topic: A question about animated sprite timing

29 February 2016 - 10:43 AM

From what I gather you're trying to time your sprites in a way that the feet don't "slide" along the ground?


You'll need to keep track of the time passed between frames(delta)


Delta can be calculated by subtracting the current system time of the previous frame from the current system time of the current frame.


Each frame in the animation will cover a certain range 0-25 ms, 26 -50 ms. 50 - 60 ms, ect.. You can either assume the time is uniform or assign different lengths to each frame, but keep track of the total time the animation takes to play out. In this case 60 ms (totalAnimationTime).



1. Each time the sprite is updated pass in the frame delta. Keep track of the total delta time the sprite has been in the animation(deltaTotal).

2. Find the local delta (how far you're into the animation loop. (localDelta = deltaTotal % totalAnimationTime ) modulo finds the remainder.

3. If local delta is 0-25 ms render the first frame. 26-50 render the second, 50-60 ms the third, ect.

In Topic: General Pathtracing Rendering and Unity

11 February 2016 - 03:42 PM

It doesn't look like unity allows you to create a different render. Unity supports compute shaders you could implement one through those, but I'm betting a path tracer isn't something you need. They're still not suited well for real time applications.

In Topic: Frustum Culling Question

01 February 2016 - 11:47 AM

For the static objects, the easiest option is to build one of trees Tangletail mentioned as the scene is being loaded; but if your scene is dynamic, then these trees will have to be rebuilt every frame. With dynamic scenes your best bet is to use the GPU and NVIDIA has a great paper on the subject. The examples they give are in CUDA; because well... That's their thing. But the algorithms could be implemented in OpenCl or Compute shaders all the same. 




BVH Trees are also a great tool.

In Topic: Frustum Culling Question

01 February 2016 - 10:25 AM

If you don't factor in the model's transformation how would you know if it's in your frustum? Nothing you wrote sounds out of the ordinary, Model View Projection matrices have MVP as an acronym for a reason!

In Topic: C++ SFML and Box2D tutorials?

02 December 2015 - 07:46 PM

The thing is physics and graphics are independent of each other. In box2d each entity in the world has  properties such as translation and rotation, use these properties to decide where to render and how to orient your sprites; whether you render using SFML, SDL, or your own library is arbitrary. Also Box2d coordinates are not pixel coordinates, they're "meters" even though dimensions don't exist in the digital world.


Are you having any specific issues such as entities not being spaced correctly?