Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Oct 2011
Offline Last Active Today, 10:10 AM

Posts I've Made

In Topic: Skeletal animation with COLLADA

14 April 2015 - 01:02 PM


mat4 animationTransformation = TRANSFORM_Root * vertexWeights0 + ...


Correct me if I'm wrong, but it appears that you're performing a matrix calc for each bone for each vertex. If so, that's very inefficient and, either on the CPU or GPU, is a waste of computing time and power. I.e., it's likely that most of the vertex weights are 0 anyway.


A more common approach (in the shader) is to multiply the vertex position by only (for example) the 4 bone matrices that affect that vertex with the largest (normalized**) weights. That is, for each vertex, determine the indices of the bones with the 4 largest weights, and store those indices and weights as part of the vertex structure. That resorting should be done for the model file (and written out to a custom file to be used for your app) before it's loaded into your app. It needs be done only once.


** By normalized weights I mean: select the 4 bones with the greatest weights for that vertex. Rescale them such that weight1 + weight2 + weight3 + weight4 = 1.0. Then store the first 3 weights. The fourth weight can be later calculated as 1.0 - wt0 - wt1 - wt2.


You then store all the bone matrices in an array in the shader and end up with something like the second code set here. In particular, note that the bone indices and weights are input per vertex, rather than vertex weights per bone.


Yeah, you're right. That is just hard coded currently so I could get a simple animation up and running and get it to work before I optimize and generalize it.


-- snip --

Thanks! That's exactly what I needed to get it up and running!

In Topic: web based dungeon creator

30 May 2013 - 04:10 AM

Is there a game bound to this or is it for physical role-playing? In that case there's quite a lot of competition, one of the best IMO is http://donjon.bin.sh/fantasy/dungeon/

In Topic: Feedback on turn-based combat system

21 May 2013 - 12:59 PM

Okay, so the game is more of an arcade dungeon crawler than a traditional RPG. All the levels are randomly generated and your goal is to make it down to the last level and defeat an end boss. As usual with roguelikes, the game features permanent death, so if you die you have to start from the beginning.


Leveling up and character progression doesn't exist, the lower health means greater power is there to replace the traditional experience and levels. Since the game is arcady and really meant to be played is shorter amounts of time I wanted something other that's interesting than long character progression and story that you have to spend lots of time on.


The power-ups are consumables found in the randomly generated world and increase your character relative to her current powers. There's not many of them in order to keep the game simple and arcady. I'm still trying to keep some depth via the combat system.


I hope that clears up a little about the game and my intentions. The game is in quite a niche genre and a hobby project, so having to attract a large audience is not a primary goal.

In Topic: Detect if link opened in new tab or window or direct url access

08 May 2013 - 01:57 PM

You could detect if the request is an AJAX request and redirect to the index.php if it's not. Altough as almost anything else, the header can be spoofed so it's not 100% proof. But for "legit" users it will most likely work.



In Topic: Loading PHP file into DIV via AJAX

05 May 2013 - 03:28 AM

$('#result a').on('click', function() {
    return false;


Something like that? That will load the page the anchor links to. This affects all anchors in the div though, you might want to change the selector to only affect a specific class.