Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

175 Neutral

About SapphireG

  • Rank

Personal Information

  • Interests
  1. I could be mistaken but I guess that in 3.3 GLSL, division by zero would result in undefined behavior. From page 21 of the official spec (https://www.opengl.org/registry/doc/GLSLangSpec.3.30.6.pdf) :   "Similarly, treatment of conditions such as divide by 0 may lead to an unspecified result, but in no case should such a condition lead to the interruption or termination of processing. Generally, there are no signaling NaNs, and operating on NaNs (Not a Number) or infs (positive or negative infinities) gives undefined results."
  2. SapphireG

    Need one more book on graphics programming ;)

    How about Real Time Rendering (http://www.realtimerendering.com) ?
  3.   Then maybe try and set the z coordinate to 0 instead of 1? That would be my first guess.
  4. SapphireG

    Why did my SSD just die?

    Have you tried plugging it on another pc as a secondary disk or something like that? Just to see if it at least gets recognized?   Anyway...I had a very similar problem with an OCZ Vector 256GB. It all started with a freeze like the one you described, then the disk was nowhere to be found after 1 or 2 minutes upon booting. After contacting their support, they suggested I would create a bootable media of their OCZ ssd guru toolkit and boot in it. Suprisingly, it worked! I was able to see the ssd without it disappearing.   Well, I couldn't save any data, but it managed to save the disk so I was happy with the outcome. I performed a firmware update, a secure erase of the disk (so it goes back to its factory default state), and then clean installed everything from scratch. This happened like, 4 months ago, and I haven't seen any signs of malfunction since. I have this ssd for a total of 3 years now and that was its only problem, so as far as market recommendations go, I would easily buy an OCZ disk again.   I definitely recommend contacting their support and posting on their forum, you have nothing to lose. They are fast, friendly, and did the job for my case. I hope you can save your disk as well.
  5. Stay tuned! One of the actual developers of the game will shortly be with you :D
  6. SapphireG

    Book for learning modern OpenGL?

  7. SapphireG

    Trouble with uniform matrices

      Not really, it's pretty common...   Can you show us some client side code? Are both your calls to glUniformMatrix4fv() correct?
  8. SapphireG

    Books and Tutorial Recommendation

      I second that. Also found http://learnopengl.com/ to be very beginner-friendly. It even has a 'offline book' section that provides the whole website as a downloadable pdf.
  9. Could you please define "it stops working" ? What is its behavior?   Just a speculation by my part... layout (location = 8) in uint DrawIDs; ... OUT.DrawID = DrawIDs; How are you passing this attribute? Can you paste the code? If you're using glVertexAttribPointer() make sure you have normalized set to GL_FALSE, or try using glVertexAttribIPointer() instead.
  10. Hi all, once again.   I'm building an .obj file loader for practice, and I have come into an issue I can't figure out. I'm trying to render Suzanne the monkey. I get into Blender and add the model in the origin:    [attachment=25797:suzanne-default.png]     As it is right now, the monkey is looking down the negative Y axis. But, since i'm planning to position my camera at positive Z and want to look straight at the monkey, I rotate the model -90.0 degrees on the X axis:   [attachment=25798:suzanne-rotated.png]   Ok, that looks desirable now. I export the model using the settings below:   [attachment=25801:export.png]   which look about right.     The crucial parts of my code are below:   1) Camera stuff Cam.position = glm::vec3(0.0f, 0.0f, 5.0f); //On the +Z axis Cam.front = glm::vec3(0.0f, 0.0f, -1.0f); //Looking down at the -Z Cam.up = glm::vec3(0.0f, 1.0f, 0.0f); //Typical up vector Cam.updateViewMatrix(); glm::mat4& CCamera::updateViewMatrix(void) { this->viewMatrix = glm::lookAt(this->position, this->position + this->front, this->up); return this->viewMatrix; } 2) Model stuff glm::mat4 model; model = glm::mat4(); // Just the identity 3) Projection projection = glm::perspective(glm::radians(Cam.fovy), //fovy = 45.0f static_cast<float>(FRAMEBUFFER_WIDTH) / static_cast<float>(FRAMEBUFFER_HEIGHT), 0.1f, 100.0f); 4) Uniforms glUniformMatrix4fv(glGetUniformLocation(renderingProgram, "model"), 1, GL_FALSE, glm::value_ptr(model)); glUniformMatrix4fv(glGetUniformLocation(renderingProgram, "view"), 1, GL_FALSE, glm::value_ptr(Cam.viewMatrix)); glUniformMatrix4fv(glGetUniformLocation(renderingProgram, "projection"), 1, GL_FALSE, glm::value_ptr(projection)); 5) Vertex Shader layout(location = 0) in vec3 position; ... uniform mat4 model; uniform mat4 view; uniform mat4 projection; ... gl_Position = projection * view * model * vec4(position, 1.0f); And i'm getting this:   [attachment=25799:no-rotation.png]   To help you, the camera is below the monkey's chin. Now, if I add this line in the 2) section: model = glm::rotate(model, glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f)); I finally get the desired result:   [attachment=25800:rotation.png]   But i can't really understand why I have to add this rotation, since I exported the model looking correctly down the +Z axis, and I can't find anything wrong with my code. What am I missing here?   Thanks in advance!    
  11. You're not passing any data to your 'model' uniform matrix, so your gl_Position is ruined. Start from there, and just see where it goes next :)
  12. SapphireG

    Textured cube with glDrawElements

      Is this a typo or am I missing something again? You have 6 sides * 2 triangles per side * 3 vertices per triangle = 36, no?     Thanks! You subtract 2 shared vertices from each side, leaving you with 24 unique vertices. I hadn't thought of that, nice :)   Much obliged for the insight!
  13. SapphireG

    Textured cube with glDrawElements

    Thanks for the quick & solid response L. Spiro.   Although, it kind of generated another (more generic and slightly off topic) question in my head:   So I have to define 36 vertices. Do I still have any advantage of using glDrawElements() with my 36 vertices and indices[] array, or should I ignore the indices[] and stick with glDrawArrays() for this specific situation?   I (till now) considered glDrawElements() a way to render objects by sending less data to the gpu, compared to glDrawArrays(). But in this example it just seems not to be the case anymore.
  14. Hi all, beginner question here.   So initially, I have managed to draw a textured cube by specifying all 36 vertices in a vertices[] array, each one with its own texture coordinates, and using glDrawArrays(). Worked fine.   After that, i wanted to do that using glDrawElements, so i specified the indices[] array (size of 36) and specified only 8 vertices in the vertices[] array. Although the geometry was rendered ok, I had problems with the textures, and I then realized that this approach would not work. I understood the reason for that: A single point needed to have different texture coordinates each time it was part of a different face, so it has to be considered a different vertex, although these vertices would have the same position.   What is the correct approach to do this? Is there in any way doable (i'm pretty sure it is, somehow) or do you have to define different vertices, end of story? Just a few pointers to the right direction will suffice, I'll handle the rest :)   Thanks in advance!
  15. SapphireG

    FBX Weird Issue

      No, you don't have to do anything at all, it' s fine as it is (assuming it is indeed the correct coordinate). This is just one of many ways for YOU to see the number that is stored. You can even assign values in your code using pretty much the same syntax.   Now, my guess would be that some of your triangles are formed from the wrong vertices (or wrong indexes, if you use indexes). The 'back' side of the gun looks absolutely correct, but you may have ended up with a (bunch of) wrong/big triangle(s) which is/are essentially overlapping the rest of the mesh.   Have you tried simpler models than this gun? For example, just a unit cube, and print out the coordinates of all the triangles to verify if they are being read correctly one by one?   hth
  • 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!