Jump to content
  • Advertisement

ddlox

Member
  • Content Count

    95
  • Joined

  • Last visited

Community Reputation

176 Neutral

About ddlox

  • Rank
    Member

Personal Information

  • Interests
    Art
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. DaTueOwner, because u want to go from scratch, clearly this means that u want to learn how every engine part works. If someone joins with u, u will not be always able to learn what that person codes. This will make u want to learn from that person too, which means that u r better off starting alone then later have someone join in on the basis of what u can demonstrate. Many years ago (lol) , i lived with a friend and we started an engine from scratch, he poured in more code than me because he worked on it full-time as he had no job at the time and I could only pour in part-time on some evenings as I had a full-time job (not games). Eventually my mate stopped because he thought I was lazy lol. Then he got hired in game dev and produced some AAA games. I then decided, as a hobby, to create my own engine from scratch in the evenings. I went about it alone and I have to say that I rewrote it several times as there were some parts which were very difficult to crack open, and at the time when i started information was scarce. But eventually I learnt a lot, I never felt under any pressure from any peers, etc... today the engine is doing quite well, supports both ogl4+ and dx11 and it's got ...cameras, character animation, etc... and even a 3d editor The beauty really is the fact that I can explain how every part works. I was invited to present the package at a conference to some young aspiring game developers and software engineers and they loved it. If anyone wants to join with u on this journey then fair enough, give it a go, have fun and learn together. However, my advice is also to try on your own first, as others have suggested earlier, forget AAA quality as u rightly said, plan a demo and code yr graphics towards it, instead of coding graphics features just for the sake of it. There are many graphics features that I haven't coded yet but I ain't doing them just for the sake of it if I don't need them. Also when u say from scratch please don't do it from scratch per se, please use some existing libs, glm (for maths) or stb's for texture loading... you'll save yrself time and still have plenty of things to code. Anyway, have fun and all the best. Peace!
  2. U need to call calc_inv_bind_transform( ) once at load time and in this function your bind_local_transform matrix needs to be set to your matrix_transposed (i.e. for each joint). I'm assuming that matrix_transposed is correct when u create it from file read. This way each joint will have a correctly calculated inverse_bind_transform matrix. So now, your entities_blabla.local_transforms should really be called blabla.final_transforms . It is these matrices that u send to the vshader (joint_transforms), they r the model space transforms of your joints which will transform vertices from their bind pose (where no animation is applied) to the desired/current/final animated pose. To calculate these final transforms, u need this: void apply_pose (joint, mat4 parent_m) { mat4 curr_m = parent_m * joint.local_m; // calculates the joint's model space transform foreach (child : joint.children) { apply_pose (child, curr_m); } _blabla.final_transform [joint.index] = joint.inverse_bind_transform * curr_m; } call it: apply_pose (root.joint, glm::mat4 (1)); joint.local_m == your bind_local_transform == your matrix_transposed (all the same thing). However when u create the animator class joint.local_m will be the new (rotation * translation) transform obtained/calculated in the interpolation function. This will be the bone space transform of your joint in relation to its parent. Yes when u force final_transforms to identity matrices, what u see rendered is cowboy in its bind pose when no animation is applied. This apply_pose () function will do the same thing as well without having u to force identity matrices yr self. When no animation is applied and when joint.local_m is set to the matrix that was loaded from file (your matrix_transposed) then apply_pose () will set final_transforms[ ] to identity matrices. The rendering is then the bind pose. Note also that in some case where the bind pose's root joint is a child of another global scene node then final_transforms becomes: Balblab.final_transforms = global_scene_node_m * joint.inverse_bind_m * curr_m; If global_scene_node_m is not in world or model space, then u will have to also invert it: .... = inverse (global_scene_node_m) * joint.inverse_bind_m * curr_m; If I remember well, this video tutorial did not have a global node attaching cowboy. So first try without this global node. U can try all this without the animator class. When u then get to animate poses, u then want a new function to calculate_current_pose ( ) then u want to call apply_pose ( ) again right after it. And this time, joint.local_m should be set to the new R * T transform. I can't remember the exact name for calculate_current_pose () but it's all in the video tutorials 2 or 3. Or just check his accompanying code. That's it. All the best. Peace!
  3. Babaliaris, the fragment shader u posted looks like the vertex shader u posted :-)
  4. lol - don't u just love it :-D correct, u don't need the animator code to render cowboy at bind pose. U haven't shown how u calculate your joint_transforms array: uniform mat4 joint_transforms[MAX_JOINTS] I suspect incorrect matrices in this array. If by assumption, all matrices are correct then aJointIndices has mixed up or incorrect bones indices.
  5. datboi That ogl text rendering definitely can be moded for directx. The thing to bear in mind is that the 2D transform is different for dx and gl. I've noticed in yr code that yr UV is always (0, 0). In yr case it should be: 1,0 0,0 1,1 0,1 1,1 0,0 Also i have not seen yr index buffer but again in yr case it should be: 0, 1, 2, 3, 2, 1 So check those. To check if yr output is right. Things u can try: - just try to draw 1 glyph only. That 1 quad. So put a "break;" in yr for loop for now - force sx = 50; for example and sy = 100; - turn off alpha blending so when the quad gets rendered it is fully visible - turn off cull mode - make sure winding order is set for clockwise - in the pixel shader just do something like "return float4(1,1,1,1);" so u force a white colour out These tips are how u can get yr freetype glyph rendering investigated/fixed and then improved on
  6. Natte, r u following an online tutorial? If yes which one ? If no then try searching youtube for opengl character animation. There's one with the cowboy character wearing a hat doing a simple run in blue trousers. Uses collada. Follow that. Can't get it wrong. Otherwise, share your cpp code and vertex shader here
  7. ddlox

    GPU Terrain Physics

    When you play some AAA games you will notice that some characters do sink into the floor (or gound) or do also float on some platforms. So I personally wouldn't worry too much about it. What you don't want to see happen is that your character collision gets the player stuck into a wall or bush, with the only resolve being to restart a game checkpoint. (This has happened in Uncharted 2 in a swimming pool level and in Uncharted 3 when I sent the boy jumping from the roof into a bush on the adjacent balcony) Fixing those will get your collision detection into the right direction.
  8. Sorry, my previous post didn't go well, here it is corrected: bool myfunction (int i,int j) { return (i<j); } int main () { int myints[] = {32,71,12,45,26,80,53,33}; vector<int> myvector (myints, myints+8); // 32 71 12 45 26 80 53 33 vector<int>::iterator it; sort (myvector.begin(), myvector.end(), myfunction); // 12 26 32 33 45 53 71 80 for (it=myvector.rbegin(); it!=myvector.rend(); ++it) // notice I used "r" for reverse traversal cout << " " << *it; } the output will be: 80 71 53 45 33 .....
  9. Are you traversing your sorted list from last to front? [source lang="cpp"]// here is a bit of code to do a back-to-front traversal in a vector (or list) of ints. bool myfunction (int i,int j) { return (i<j); } int myints[] = {32,71,12,45,26,80,53,33}; vector<int> myvector (myints, myints+8); // 32 71 12 45 26 80 53 33 vector<int>::iterator it; std::sort (myvector.begin()+4, myvector.end(), myfunction); for (it=myvector.rbegin(); it!=myvector.rend(); ++it) // notice the reverse search by using "r" cout << (*it); [/source] so the output will be something like: 33 53 80 26 ... - replace myvector with yours (whatever list or structure set that you're using) - replace myfunction with your distance_to_camera function - replace cout << (*it) with your render call I'm doing this from the top of my head, but that's the main gist done in clever engines :-)) Good luck.
  10. The problem that you do not realise is that 'you are mixing 2 things into 1 Framerate (FPS) and Rendertime (RT)'. Looking at your gameloop, I can tell that it is framerate dependent loop. No doubt about that. Why? - because your update call feeds with the last RT and this RT is produced by an uncapped Framerate. That's why your bullet still travels fast/slow because you are rendering what the last rendertime dictates (rather than what the last update should dictate). Your framerate should ALWAYS be capped (or fixed) and your rendertime is ALWAYS variable. This last rendertime variance is then broken into steps into your future update calls for the next frame. This is how your loop becomes framerate independent. Currently, your render call comes immediately after the update call, which is fed with the last render time. This is a typical scenario for framerate dependency. This is why your bullet will still seem to be fast or slow (depending on CPU). To achieve independence you need to do what Firestryke31 or the suggested link said. What he/she posted there is typical scenario for framerate independence. This method will allow you to cap or fix your framerate (FPS) and allow your render time (RT) to feed into your next update call in steps . As an example: you can cap your game loop to always run at 60FPS on slow and fast machines, but your RT will be the one changing. Your updates (logic) will therefore take place in steps as highlighted by Firestryke31 then after those updates you call render. You cannot achieve framerate independent updates with immediate render call after it, it will never work well across CPUs. You need to break down your updates in steps. Good luck.
  11. ddlox

    explicit constructors

    Marek, Explicit constructors have been in placed for years. It's standard c++. You should always use explicit (whereever possible, whenever possible). What to bear in mind is that this form, you wrote, does call a constructor and not the assignment operator. It doesn't fool the compiler, unless your compiler is a very old one (which probably would fail). Without explicit specified, your compiler will call your constructor with a matching parameter. It's programmer-fool, rather than compiler-fool. In other words, "Marek-didn't-know.com" :-)
  12. ddlox

    Removing Scale from matrix

    Aha! I see... I wasn't doing the left multiply at all. OK cool thanks and sorry for posting in the wrong forum, I didn't realise I was in Lounge.
  13. ddlox

    Removing Scale from matrix

    Hi guys, I have this transformation matrix M = Scale * Rot * Trans At some point later in my code, I'm trying to remove scaling from M. I'm currently failing big time... I guess I'm tired or something.. can't think straight. Could anybody tell me how ? Thanks.
  14. ddlox

    Proof God doesn't exist?

    My view on the OP: Let ObjectA denote a solid or non-solid object - If the whole world can erase ALL information available about ObjectA (even from human thought) then ObjectA will cease to exist - If you had access to ALL space and ALL time, and if in this environment you cannot find the smallest particle of information about ObjectA then ObjectA does not exist So ObjectA exists as long as ANY information about it is. Example: If I could erase all information about my friend Joe (DNA, bones, flesh, blood, etc...) he will cease to exist, but if there is any form of information about Joe (whether found at the morgue, or in burn ashes particles, etc...) then Joe whether dead or alive does exist. So I believe it is with God as well... the fact that there is a lot of information about him, whether this is man-made-or-twisted, divinely inspired or not, altered or original, means to me that he exists. He will cease to exist if ALL information to the smallest particle about him is erased.
  15. Hi Sorry to post it here, but I don't know who the appropriate moderator for WIKI is. It's not been online for 3 - 4 days now since the new year: http://www.gamedev.net/community/forums/topic.asp?topic_id=592153 Who can fix it? Many thanks, ddlox
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!