Jump to content
  • Advertisement

Uttam Kushwah

  • Content Count

  • Joined

  • Last visited

Community Reputation

14 Neutral

About Uttam Kushwah

  • Rank

Personal Information

Recent Profile Visitors

3434 profile views
  1. Uttam Kushwah

    3d picking inaccuracy.

    Thanks but my problem is solvedπŸ’ͺπŸ˜„πŸ‘Œ. It's all working perfectly.
  2. Uttam Kushwah

    3d picking inaccuracy.

    finally i have figured out and solve the problem( of course with your help ), after you suggested that, set the frame buffer size as window height and width before projection matrix creation, i tried and it didn't work because problem was something else. I didn't Listen to you (@GoliathForge) because of this (Note :it is not my excuse i am explaining real scenario.) i have been doing this since when i ported to glfw within each iteration, where global is my camera pointer. It didn't work this time too because this was not the problem ( As i mentioned before the ambiguous output ). It is very hard to explain what i thought. In simple words the problem was i didn't updated the drivers of intel gpu and now i have updated them so problem solved( And it also explains why the program was working correctly only on nvidia gpu). Thanks all of you and Sorry because every single thread i created here on this website for my problem is based on my own dumb mistakes and i always figure them out very late😭😭😭😭😭😭😭😭.
  3. Uttam Kushwah

    3d picking inaccuracy.

    really it worked thank you very muchπŸ˜­πŸ˜‚, /*but what could have gone wrong because i don't want my window stuck to the corner is this client area messed up.*/ (i should have shown some dignity by not asking that question after you helped me this much, i will try it to do by digging more.) once again thank you very much.
  4. Uttam Kushwah

    3d picking inaccuracy.

    The window size ,same as I give in the glfwcreatewindow after I retrieve frame buffer size and set it in camera height And width.
  5. Uttam Kushwah

    3d picking inaccuracy.

    I am using Windows 10. i worked up my whole day in this issue and found that the mathematical calculation are same on both the graphics processing unit as in the below image. i hard corded the click in the top left corner and printed the output as shown in the below code snipet but when i was doing the test i found that both the graphics processor drawing the exact scene with different ratio or with some offset as shown in the image below . (Of course with same camera position and target) as everyone can see that the model on the top of the screen in right window is drawn inside the window while in the left window the model is out of the window and cut by it. i don't know why it matters because i am doing rayCast with bullet physics on my 3d world data and their is no inclusion of any type of rendering pipeline functionalities rather than getting the cursor pos but as i told before the cursor position comes out pretty much the same every time for both gpus there is no defect. And the main thing the calculation for ray is also based on cpu processing as shown above. If anybody wants my shaders info then here it is basic.frag,basic.vert. ( on the other hand i don't think its giving some clue since calculation of the ray points are same for both the gpus and so output ray points too, and the thing is if i got the ray points same then why does it matters that on which gpu i am running the program because the 3d world data is independent of gpu program (as i think)."The most annoying thing in debugging is ambiguous output😣 " ) This is pretty much all i got from todays research. Hope this data give some clue someone.
  6. Uttam Kushwah

    Understanding Entity Component System?

    first of all i apologize. because i think i was really doing very dumb thing. yup you were right, at some point i thought that game development is so hard that you have to get into really to the core of processor(for a simple game too). With that in mind i just asked that question to really optimize thing up using ECS. But you(me as in third person) should be smart enough that you would be able to understand the difference between the release and debug mode. That was my real issue that i had build the bullet physics in the debug mode which is figured out by me after reading a lot of posts on bullet physics optimization. Now there is a huge difference in performance. So Thanks every one. sorry once againπŸ˜–πŸ˜­ . That i have wasted such precious time of you experienced people which you could have utilized in helping other people on the forum. I'd be careful next time whether to post or not a specific topic.
  7. Uttam Kushwah

    Understanding Entity Component System?

    here is the link for video which shows my project running state i know this recording is of bad quality but its hard for me to do recording things i don't get it Sorry. but as you can see in the video all character uses such simple lowpoly model with low resolution textures. The simulation in the video is running at 200-250fps but if i add more character then it goes really down. this is it.The same model which is used by thinMatrix to show skeletal animation.
  8. Uttam Kushwah

    Understanding Entity Component System?

    Core-i5 7200u dual core four threads, 8gb ram, Nvidia 920mx 2gb. I don't think it can't handle it. Can't it?
  9. Uttam Kushwah

    Understanding Entity Component System?

    Sorry for the inconvenience i am newbie here. Actually i am really going to use that code which is shown above. should i decouple the rigid body from the logic. I am using it in the seek behavior to move object directly because i need it here for getting its current velocity and act accordingly. But if i just remove it from here then i have to make a new system and component as you mentioned up there for positionSystem and associate each entity that component(which needed it) and in the positionSystem it will update velocity,position for all rigidBodies in single go. Current Approach: Second approach: That is pretty all i understand from your explanation. No, i am doing it for optimization purpose , in my current approach i can only able to render 25 character at 40fps but i want at least 50 character. Yes i know this is too inefficient even for a small rts having only 100 character but i am using compound shape instead of capsule collider which make it pretty hard to survive in such tightly coupled system. if anyone can give me some simple system architecture diagram like component system which unity uses but don't show how? that would be really helpful.(sorry if i am asking for something really specific) Note: i didn't mean unity uses some simple component architecture i mean i want simplified understanding of that thing. but as everyone can see i really am not getting how to organize the physical data and position data and all other stuff in nutshell so i am stuck and can't do any other work on this project just yet And if do something i just have to redo the thing.πŸ˜“(And giving up is not my thing so i am trying every single direction in which i can go) And at the very specific end i really want some thing which can run the simulation no matter what it takes, i read a lot and found that ECS can do this so i jumped into it. Thanks everyone , i really didn't mean to west anyone's time.😒
  10. Uttam Kushwah

    Understanding Entity Component System?

    i don't know it is the right way for an example i have different sets of operation can be performed on each single character(id) like seeking to the position,attacking to the enemy by pursuing him etc. for instance let say character have a have static pointer to the StrategicSystem and it will add its related physicalBody and id , seek_point as we do in pure ECS class StrategyManger { struct SeekerObject { btVector3 seek_point; btRigidBody* body; }; /* and many more */ std::map<unsigned int,SeekerObject> seekers; static physicsSystem* game_world_physics; static objects::Camera* camera; public: StrategyManger(physicsSystem* game_physics,objects::Camera* cam) { game_world_physics = game_physics; camera = cam; } void seekUpdate();// will iterate over each seeker object and change them accordingly. void addSeekerObject(const unsigned int id,btRigidBody* seeker,btVector3 seek_point);// called by the character which needs to be updated { SeekerObject t; t.seek_point=seek_point; t.body= body; seekers.insert(pairs<id,t>); } }; all character needs to do is class character : EventHandler { private: btRigidBody* body; static StrategManager* strategic_manager; unsigned int id; public: void handler(const Event* e); void setSeekPoint(const Event* e); }; void character::handler(const Event* e) { switch(e->type) { case MOVE_COMMAND: { this->setSeekPoint(e); }break; } } void character::setSeekPoint(const Event* e) { pickingSystem* p =(pickingSystem*)e->args2; btVector3* seek_position =(btVector3*)e->args1;//make a cop btVector3 seek_point=*seek_position; delete seek_position; for(unsigned int i =0;i<p->num_picked_objects;i++) if(p->picked_objects==my_id) { strategy_manager->addSeekerObject(my_id,body,seek_point); } } So above the strategyManager is a system id is entity and seekPoint , body are component for the id. am going right.
  11. This article is on wikipedia says that we can change the behavior of the game entity by adding or removing the component at runtime how it goes i don't know. What i am doing is, I have a gameObject class which is having four components class gameObject { public: #define MAX_COMPONENT 4 unsigned int components[MAX_COMPONENT]; gameObject() { for(int i=0;i<MAX_COMPONENT;i++) { components=0; } //parent_id=-1; } }; i don't use inheritance, Whenever i make the new game entity i add an gameObject in the gameObjectManger class using the game entities constructor with all of its components filled at the time of game entity creation like index for rigid body , mesh and etc. Then i use these gameObjects at individual systems to run the game like below // For renderer for(unsigned int i=0;i<manager->gameObjects.size();i++) { unsigned int meshIndex = manager->gameObjects.components[MY_MESH]; //mesh data mat4 trans=(*transforms)[bodyIndex];// The transformation matrix extracted and spitted out by the the Physics engine mesh_Entries[meshIndex].init(); GLuint lMM = glGetUniformLocation(programHandle,"Model"); glUniformMatrix4fv(lMM, 1, GL_FALSE,&trans[0][0]); mesh_Entries[meshIndex].bindTexture(); glBindBuffer(GL_ARRAY_BUFFER, mesh_Entries[meshIndex].getVertexBuffer()); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_Entries[meshIndex].getIndexBuffer()); pickColor=vec4(1.0f); pickScale=mat4(1.0f); lMM = glGetUniformLocation(programHandle,"pick"); glUniform4fv(lMM,1,&pickColor[0]); lMM = glGetUniformLocation(programHandle,"pickScale"); glUniformMatrix4fv(lMM,1,GL_FALSE,&pickScale[0][0]); // This is very basic rendering since all object's indices are treated as // indexed based. Stored in element buffer with indices and vbo with vertices // for each single gameObject having their own VAO and IO. Optimization need to be done later on. glDrawElements( GL_TRIANGLES, // mode mesh_Entries[meshIndex].getIndicesSize(), // count GL_UNSIGNED_SHORT, // type (void*)0 // element array buffer offset ); } but i am not getting it how to add a new component like LogicalData to the gameObject not about how to point from gameObject but how to build one is this should be my approach struct LogicalData { float running_speed; vec3 seek_position; vec3 attack_point; }; Character : public CharacterController { private: gameObject* me; public: // methods to manipulate gameObject content using the component id for each component in their container // i.e is to update component[LOGICAL_DATA] in the gameLogicContainer }; and then a global container which hold this logical data and every entity has a id to it using gameobjects or i should not be doing this at all. i can just put all logical data into the any game entity like this and push the physics and rendering data back to gameobject Character : public CharacterController { private: float running_speed; vec3 seek_position; vec3 attack_point; public: // methods to manipulate above }; Any comments will be greatly appreciated.
  12. Uttam Kushwah

    Help Finding Continuous Collision Detection Resources

    Ok may be you can look into bullet physics source code, since i am using bullet for my game and i have faced the same tunneling problem .But it is handling it very well now with CCD. now i can shoot balls of 1m radius with 1000m/s without tunneling. May be it will give you a hint. note: I really don't know about anything in terms of CCD implementation or any physics rather than basics.
  13. Uttam Kushwah

    undefined behavior of bullet objects.

    The ccd didn't work before because i messed up with the terrain bounding box problem, which is nothing but some minimum and maximum height issue. Now it's all working fine even with 1000m/s velocity for a sphere of radius 1m with following ccd configuration body->setCcdMotionThreshold(1); body->setCcdSweptSphereRadius(0.2f); i didn't try bothering myself by changing the parameter of the post which i read before when i first tried ccd.Guess what i won't have to change it. One can tweak the parameter of above function according to their fast moving body dimension to get the correct result.(sorry if That is obvious)πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€πŸ˜€ Thanks all of you.
  14. Uttam Kushwah

    3d picking inaccuracy.

    This how i am generating projection matrix.. These are extensions used for drawing with openGL.. Here is my draw command.. This is all i have and i am doing as in name of renderer. I know it needs to be optimized but for now its doing. As mentioned above i am not using any other extensions rather than those up there. Sorry if i am doing some lame mistake. Which is giving me hard time and annoying all of you.😞
  15. Uttam Kushwah

    3d picking inaccuracy.

    you are right but the problem is ambiguous output in my case,which is depending on the type of processor program is running on. i tried hard coding the cursor position and client dimensions and it still gives correct output for the nvidia gpu and deflected one on for intel(integrated) gpu. now i will try to re-transform the generated 3d ray points in the world to the client space manually and find the deflection but i don't know will it give me a hint about how to deal the deflection intel gpu?😫😫😫😫😫😫😫😫
  • 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!