• 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.

alb

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

107 Neutral

About alb

  • Rank
    Newbie
  1. [quote name='FXACE' timestamp='1341443376' post='4955793'] I believe it more looks syntax call error than frame buffer problem. Your code: [code] gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, frameBufferID[0]); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glPushAttrib(GL.GL_VIEWPORT_BIT); // <--- You saved viewport bits gl.glViewport(0, 0, floorWidth, floorHeight); gl.glBegin(GL.GL_QUADS); gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3d(-1, -1, 0); gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3d(-1, 1, 0); gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3d(1, 1, 0); gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3d(1, -1, 0); gl.glEnd(); gl.glPopAttrib(); // <-- You restored previous attribute values (viewport bits) gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); gl.glPopAttrib(); // <-- What it does restore??? gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); [/code] Best wishes, FXACE. [/quote] No the last two rows are a copy&paste error: [CODE] gl.glPopAttrib(); // <-- You restored previous attribute values (viewport bits) gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); [/CODE]
  2. I would like to implement the approach of the virtual texturing. I'm following the instructions of this thesis [url="http://www.graphics.rwth-aachen.de/uploads/media/neu_virtual_texturing_low_03.pdf"]http://www.graphics....ring_low_03.pdf[/url] I need what the author calls "Needbuffer" (pag 14). I'm more or less at this point: [media]http://www.youtube.com/watch?feature=player_embedded&v=ONYt4hbitFE[/media] and using the information about the level of detail I would like to load a texture composed with different level of details like in this video: [media]http://www.youtube.com/watch?feature=player_embedded&v=YCZl16JMF08[/media]
  3. Ok now I going to describe my situation: In the screenshot there is my running program. In this case I take what is rendered and I put all of it on a 2dtexture that I rendered on the left of the screen. But I would like to put in the 2dtexture only the quad (that is the output of the shader); as you can see the output is a grid that represents a level of details based on the distance of the camera. I would like to put that information on a texture in order to retrieve the level of details. This is the fragmentShader: [source lang="java"]#version 150out vec4 fragColor;varying vec4 clipPos;void main(){ vec2 tx=gl_TexCoord[0].xy;//vec2 tx = clipPos.xy / clipPos.w * 0.5 + vec2(0.5); // get the length of the texture derivatives float lambda_s = length(dFdx(tx)); float lambda_t = length(dFdy(tx)); // compute the sample level, based on the maximum derivative, and the interpolation factor between ceiled and floored level float level_s; float interp_s = modf(-log2(max(lambda_s, lambda_t)), level_s); // get the new texture coordinate by scaling the texture coordinate by the floored and ceiled level vec2 tx_down = tx * pow(2, level_s); vec2 tx_up = tx * pow(2, level_s + 1); // compute the color procedural vec2 highlight_down = clamp(cos(tx_down * 0.2) - 0.95, 0,1) * 10; vec2 highlight_up = clamp(cos(tx_up * 0.2) - 0.95, 0,1) * 10; // this might be faster, but it doesn't fade nicely... //float highlight_down = step(0.9, fract(tx_down * 0.04)) * 0.8; //float highlight_up = step(0.9, fract(tx_up * 0.04)) * 0.8; // lerp between the intensities fragColor = vec4(1 - clamp(mix( max(highlight_down.x, highlight_down.y), max(highlight_up.x, highlight_up.y), interp_s), 0,1));}[/source]
  4. I have a problem with this piece of code: [source lang="java"]gl.glGenTextures(4, textures, 0); gl.glBindTexture(GL.GL_TEXTURE_2D, textures[3]); gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, floorWidth, floorHeight,0, GL.GL_RGB, GL.GL_FLOAT, null); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP); gl.glGenTextures(5, textures, 0); gl.glBindTexture(GL.GL_TEXTURE_2D, textures[4]); gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_DEPTH_COMPONENT16, floorWidth, floorHeight,0, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, null); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); int tex1=textures[3]; int tex2=textures[4]; //GENERATE FRAMEBUFFER gl.glGenFramebuffersEXT(1, frameBufferID, 0); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, frameBufferID[0]); gl.glFramebufferTexture2DEXT(GL.GL_FRAMEBUFFER_EXT, GL.GL_COLOR_ATTACHMENT0_EXT,GL.GL_TEXTURE_2D, tex1, 0); gl.glFramebufferTexture2DEXT(GL.GL_FRAMEBUFFER_EXT, GL.GL_DEPTH_ATTACHMENT_EXT, GL.GL_TEXTURE_2D, tex2, 0); if(gl.glCheckFramebufferStatusEXT(GL.GL_FRAMEBUFFER_EXT) == GL.GL_FRAMEBUFFER_COMPLETE_EXT) { System.out.println("[Viewer] GL_FRAMEBUFFER_COMPLETE!!"); } else System.out.println("..error"); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); [/source] At the end of this initialization code, I have an FBO (frame buffer object) with no errors; it prints "[Viewer] GL_FRAMEBUFFER_COMPLETE!!" But when I try to render something: [source lang="java"] GL gl = drawable.getGL(); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, frameBufferID[0]); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glPushAttrib(GL.GL_VIEWPORT_BIT); gl.glViewport(0, 0, floorWidth, floorHeight); gl.glBegin(GL.GL_QUADS); gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex3d(-1, -1, 0); gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex3d(-1, 1, 0); gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex3d(1, 1, 0); gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex3d(1, -1, 0); gl.glEnd(); gl.glPopAttrib(); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); gl.glPopAttrib(); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); int errorCode = gl.glGetError(); if(errorCode!=0){ String errorStr = glu.gluErrorString( errorCode ); System.out.println("...error: "+ errorStr ); System.out.println("....errorCode: "+ errorCode ); } [/source] It return the following error: ....error: invalid framebuffer operation ....errorCode: 1286 Do you know why? Thanks. Alberto
  5. I mean Ok I have the output of the shader in the quad. But how can I use the information contained in that output? For example I would like to use that information in order to retrieve the level of details of each pixel. I would like to have a buffer and each element represents the level of detail of the corrensponding pixel. Is it clear?
  6. I have a question: If I want to use the information contained in the output of the shader, how can I do that? For example how can I convert the output of the shader in a texture? I tried using glFramebufferTexture2DEXT, glBindFramebufferEXT, etc.. but in this case I have a texture with all the scene renderized, not just the output of the shader of the quad.