• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

akaitora

Members
  • Content count

    212
  • Joined

  • Last visited

Community Reputation

399 Neutral

About akaitora

  • Rank
    Member

Personal Information

  1. Why/When should you call DiscardResource?  https://msdn.microsoft.com/en-us/library/windows/desktop/hh404613(v=vs.85).aspx   What does this method buy you?  Is it essentially like the free method in C?  
  2. Hey guys! My team just released our latest creation, "Deer Hunter 2016". We managed to get featured in the iTunes, Google Play, and Amazon stores.  It is available on both iOS and Android platforms.     iTunes https://itunes.apple.com/app/id893372761?mt=8   Google Play https://play.google.com/store/apps/details?id=com.glu.deerhunt16&hl=en   Amazon http://www.amazon.com/gp/product/B0131KZRMG/ref=mas_billboard   https://www.youtube.com/watch?feature=player_embedded&v=2C2heMcl9u0
  3. OpenGL

    mhagain, thanks for the solution!  That fixed it!  I didn't realized that glVertexAttribPointer required the buffer to be bound before use.  Thanks for the heads up!
  4. Great video!  For more information on the Dot Product and its properties along with some more real world use cases, check out my article.     http://xdpixel.com/dot-product-101/
  5. OpenGL

    btw, for my Begin/End shader code,  I am doing the following     //--------------------------------------------------------------------- void ShaderFx::BeginPass() {     glUseProgram(shaderProgram);          if( !modelHasUvs )     {         GLint vertexAttribLocation = glGetAttribLocation(shaderProgram, "vertex");         glEnableVertexAttribArray(vertexAttribLocation);         glVertexAttribPointer(vertexAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, 0);     }     else     {                  GLint vertexAttribLocation = glGetAttribLocation(shaderProgram, "vertex");         glEnableVertexAttribArray(vertexAttribLocation);         glVertexAttribPointer(vertexAttribLocation, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), 0);                  GLuint texCoordAttribLocation = glGetAttribLocation(shaderProgram, "uv");         glEnableVertexAttribArray(texCoordAttribLocation);         glVertexAttribPointer(texCoordAttribLocation, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), (const GLvoid*)(3 * sizeof(GLfloat)));              } }   //--------------------------------------------------------------------- void ShaderFx::EndPass() {     GLint vertexAttribLocation = glGetAttribLocation(shaderProgram, "vertex");     GLuint texCoordAttribLocation = glGetAttribLocation(shaderProgram, "uv");          glDisableVertexAttribArray(vertexAttribLocation);     glDisableVertexAttribArray(texCoordAttribLocation); }  
  6. OpenGL

    Good catch!  Unfortunately I forgot to mention that I am handing the shader for the QuadGeom in a higher level class like so.     void onRenderImage(ApplicationContext &context) {     glClearColor(0.0, 0.3, 0, 1);     glEnable(GL_DEPTH_TEST);          glViewport(0, 0, context.ResolutionWidth, context.ResolutionHeight);     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);          context.ShaderFx->BeginPass();          context.ShaderFx->SetVector2Parameter("resolution", context.ResolutionWidth, context.ResolutionHeight);          context.ShaderFx->SetFloatParameter("time", context.TimeInSecondsSinceStartup);               float mouseX = (float)((context.MouseX - context.WindowPosX)) / context.ResolutionWidth;     float mouseY = (float)(-(context.MouseY - context.WindowPosY)) / context.ResolutionHeight;          context.ShaderFx->SetVector2Parameter("mouse", mouseX, mouseY);          context.QuadGeo->Render();          context.ShaderFx->EndPass();          glDisable(GL_DEPTH_TEST);     context.DisplayText->DrawString("", 0, 0); }     Any other ideas?  Thanks!
  7. Hi!  I am  trying to render 2 vertex buffers.  Each is setup a bit different.  The first only has positions whereas the second has both positions and uv coordinates.  If I only try to render one, the one I render looks great.  It doesn't matter which I render.  But if I render both together,  both vertex buffer become corrupt.  On screen, they both look like triangles even though they are suppose to be quads.  When I try making both use the same vertex format,  (I.E. verts and uvs) they render correctly.  This almost makes me think that they are somehow referencing each other somehow which is breaking the stride.  I am not explicitly unbinding my VBOs.  According to the OpenGL docs, I shouldn't need to.  However even when I do, it causes a crash.  Below are the classes for the 2 VBOs in question.   #include "QuadGeometry.h"   #include <iostream> using namespace std;   const float QuadGeometry::verts[] = {     -1.0f, 1.0f, 0.0f,     -1.0f, -1.0f, 0.0f,     1.0f, -1.0f, 0.0f,     -1.0f, 1.0f, 0.0f,     1.0, 1.0, 0.0f };   //--------------------------------------------------------------------- void QuadGeometry::Initialize() {     glGenBuffers(1, &vertexBuffer);     glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);     glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW); }   //--------------------------------------------------------------------- void QuadGeometry::Render() {     glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);     glDrawArrays(GL_TRIANGLE_STRIP, 0, 5); }     //--------------------------------------------------------------------- DisplayText::DisplayText() {     shaderFx = new ShaderFx();     shaderFx->Load( "shaders/font/vertex.glsl", "shaders/font/fragment.glsl", true );          vertexBuffer = 0;          textureSurface = nullptr;     textureSurface = SDL_LoadBMP("assets/textures/ddrsmall.bmp");     if( !textureSurface )     {         cout<< "Failed to Load Texture!\n";     }          /*     glGenTextures(1, &textureId);     glBindTexture(GL_TEXTURE_2D, textureId);          glTexImage2D(GL_TEXTURE_2D , 0 , 3 , textureSurface->w,                  textureSurface->h , 0 , GL_RGB , GL_UNSIGNED_BYTE ,                  textureSurface->pixels);          glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER , GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER , GL_LINEAR);     */ }   //--------------------------------------------------------------------- void DisplayText::CreateNewVertexBuffer() {     float verts[] =     {         //x    //y    //z   //u   //v         -1.0f,  1.0f,  0.0f, 0.0,  1.0,         -1.0f, -1.0f,  0.0f, 0.0,  0.0,          1.0f, -1.0f,  0.0f, 1.0,  0.0,         -1.0f,  1.0f,  0.0f, 0.0,  1.0,          1.0f,  1.0f,  0.0f, 1.0,  1.0     };          glGenBuffers(1, &vertexBuffer);     glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);     glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW); }     //--------------------------------------------------------------------- void DisplayText::DrawString(std::string string, int x, int y) {     if( vertexBuffer <= 0 )     {         CreateNewVertexBuffer();     }          shaderFx->BeginPass();          glm::mat4 Projection = glm::perspective(45.0f, 800.0f/600.0f, 0.1f, 1000.f);     glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -7.0f));     glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(1.0f));     glm::mat4 modelViewMat = View * Model;          shaderFx->SetMatrix4x4Parameter("modelViewMatrix", &modelViewMat[0][0]);     shaderFx->SetMatrix4x4Parameter("projectionMatrix", &Projection[0][0]);          glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);     glDrawArrays(GL_TRIANGLE_STRIP, 0, 5);          shaderFx->EndPass();          oldString = string; }   Any ideas would be helpful!  Thanks!
  8. Tonight I wrote a tutorial explaining how to procedurally generate noise in a shader if you need to.   Take a look here. http://glslsandbox.com/e#27370.3   I hope it helps someone!  =)    
  9. A short article tI wrote that attempts to give a little insight into how this is done mathematically.   http://xdpixel.com/random-points-in-a-circle/  
  10. So if I understand correctly, from a shader perspective, we sample a cubemap just like we would as normal.  The only difference is that the cubemap is been blurred offline. Perhaps we have multiple versions of the blur per mip map.  
  11. I came across this site   http://www.chocofur.com/6-shadersamptextures.html   And I want to write a shader that uses a cubemap for reflection but I want to take into account the roughness of the reflection.  Essentially it looks like the roughness more or less blurs the texture.  This model seems to be used in Physically based shaders.  I am curious if anyone can point me to an article that explains the formula for adding roughness to augment a reflection vector in a shader.  Thanks!
  12. Hey renman29!  That is very kind of you to say and I am glad you liked it!   I actually just made a few small adjustments to make more of a dynamic looking energy field.  It uses 2 passes of fractional brownian motion.     http://xdpixel.com/energy-field/
  13. Hey guys!  Here is a shader I wrote that demonstrates a simple way to do procedural lightning.     You will need a WebGL enabled browser to view the demo.   http://xdpixel.com/stormy-night/  
  14. @Lactose, good catch!  It has now been corrected!   @frob, fair enough.