Jump to content
  • Advertisement

Saragan

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

123 Neutral

About Saragan

  • Rank
    Newbie
  1. not sure if this is the right forum section but hey, seemed logical as fbx is an API set?   ive been developing an opengl game engine and ive been told to include FBX support because its "easy"..... well i already have obj's and MD5 meshes/anims in my engine so i thought...what the hell as exporting MD5 as opposed to fbx is more hassle ive ready the documentation, and the samples....and alls i can say is wtf? Ive manage to load a mesh from the control point however only the vertices using getControlPointAt() and getPolygonVertexCount() and GetPolygonVertices() two questions surrounding model loading how do i get the normal/color/texture co-ordinates i do a lot of archiving, is there a way for fbx sdk to read file from string or memory rather than flat file? (im using libarchive) now as with MD5Mesh i thought fbx would use something like storing a weight with the vertex along with allowing you to store which bone/bones it is tied too? am i wrong? seems a logical way of doing it... basically im stuck with animation as the examples are...confusing i just want to be able to say to the animation give me number of frames, and fps for the given animation name give me this particular frames array of bone transformations so I can assign the array as glm::mat4 and send to my shader? is that possible? any help in understanding this would be great? ive spent far too much time on this with very little progress in the matter
  2. Saragan

    Transparency Issue

    Right ok, thanks for your input, as im doing basics i think ill just try and avoid that situation for now until i have a firmer grasp   out of interest would culling the faces be a solution to that? not sure how that would work with transparency
  3. Saragan

    Transparency Issue

    Thanks for the reply I changed the render order and indeed that did seem to fix the issue which is great.   You said it still wont work for all kinds of shapes though? how do you mean?
  4. Right so i have a transparency issue that i hope someone could explain? i should see the texture through the red square.   I created a bounding box around my obj (yes that textured cube is an obj ) however i noticed a transparency issue, so i removed all sides of the box bar the top. the top is a solid red with an alpha of 0.2.   originally i rendered another transparent box behind the red one and i could see that fine, just not the textured obj, which leads me to believe it is a conbination of my shader and glblend thats the issue.     so here is my code for my frag shader, if it doesnt have a texture (coord -98) then just do colour, i dont currently have a world light set so it never goes into the first part for textures if (pass_Texture[0] <= -98.0 && pass_Texture[1] <= -98.0) { out_Color = pass_Color; } else { if(WorldLight.isWorldSource) { out_Color = texture(myTexture, pass_Texture) * pass_Color * (AmbientColor + DiffuseColor); } else { out_Color = texture(myTexture, pass_Texture) * pass_Color; } } my bounding box (in this case just the red square) as you can see ive tried a variety of options //glDisable(GL_DEPTH_TEST); //glEnable(GL_CULL_FACE); glEnable(GL_BLEND); //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, 0); glUniformMatrix4fv(shader->modelMatrixLocation, 1, GL_FALSE, &transform[0][0]); glBindVertexArray(Cube->VAOID); // Bind our Vertex Array Object glDrawArrays(GL_TRIANGLES, 0, Cube->points.size()); // Draw our square glBindVertexArray(0); // Unbind our Vertex Array Object glDisable(GL_BLEND); //glDisable(GL_CULL_FACE); //glEnable(GL_DEPTH_TEST); and finally my obj which again ive tried a variety of blend options and depthtest options, most of it is my own code but didnt want to cut incase it was something else entirely that i missed glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glBlendFunc(GL_SRC_ALPHA, GL_ONE); //glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glUniformMatrix4fv(shader->modelMatrixLocation, 1, GL_FALSE, &ModelMatrix[0][0]); glBindVertexArray(VAIO); // Bind our Vertex Array Object std::map<std::string, Group>::const_iterator itr; for (itr = Groups.begin(); itr != Groups.end(); itr++) { Group gp = itr->second; cMtl* mtl = &Materials[gp.Mtl]; if (mtl->MainTexture.loaded && !mtl->MainTexture.GeneratedBuffer) { if (mtl->MainTexture.TextType == SARAGAN_PNG) { mtl->MainTexture.GenerateAlphaBuffer(); } else { mtl->MainTexture.GenerateBuffer(); } } if (mtl->MainTexture.loaded && mtl->MainTexture.GeneratedBuffer) { if (CurrentTextureID != mtl->MainTexture.TextureID) { CurrentTextureID = mtl->MainTexture.TextureID; } glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, mtl->MainTexture.TextureID); glDrawArrays(GL_TRIANGLES, gp.index, gp.Endindex); // Draw our square } } glBindVertexArray(0); // Unbind our Vertex Array Object glDisable(GL_BLEND); for the love of me i cant seem to get the right combination, which to me suggests i dont really understand whats really going on here   if anyone could shed some light onto the situation then i would be very greatful   Kind Regards Rob              
  5. Hi guys I have managed to cast my class into lua and that seems to work fine, however, i want to cast it back to a c++ class? now i thought i could do the following from a luabind:bject Code: void cEntityManager::addEntity(luabind::object const& ent) { cEntity *thisEnt = luabind::object_cast<cEntity*>(ent); } but it seems that doesnt work? tbh im not sure if this is what i want anyway. i wanted to create an entity component system where i could create new components and new entities in lua and have my engine process and run them. however im finding it difficult to find good examples of it. should i just be storing luabind objects(derived from class entity) instead of c++ class entities and have the engine process the objects as lua? is there a way i could typecast the object back to a c++ class while still maintaining the lua overrides? any help on this would be greatly appreciated, I have read a lot on this topic and i think my brain is overburdened with too many conflicting ideas and concepts Kind regards Rob
  • 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!