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

oggs91

Members
  • Content count

    69
  • Joined

  • Last visited

Community Reputation

421 Neutral

About oggs91

  • Rank
    Member
  1. Hi Cg Gurus :)   I'm looking for interesting papers in the field of Character Animation Synthesis for an assignment at my university. The course is about writing a short state of the art report on a topic based in the field of Computer Graphics. To make sure I don't miss any interesting papers I kindly ask you to post papers dealing with Character Animation Synthesis that have caught your eye.   thx :) 
  2. yes do that, render backfaces to your shadowmap   think about how big a texel from the shadowmap is if it's projected onto your terrain, clearly the area each texel has to cover is bigger if the light is low above the ground and producing very long shadows. biasing can correct this to a certain extent but if your shadowmap resolution is too small that won't help either. a simple solution would be to just increase the shadowmap resolution, and/or limit the possible light angle. i think a proper solution would be to use a cascaded shadowmapping technique
  3. vec3 normal = normalize(transpose(inverse(mat3(u_modelMat))) * texture2D(tNormals, fragTexCoord0.xy).rgb); this has to be done in the geometry pass, your lighting pass does not know which fragment comes from what object ( u_modelMat is for a specific object ) your normal transformation was ok i think in post #3   anyway to find out why the dot product is always zero draw lightVector and normal as RGB an inspect the two resulting images (you can also make abs() to show negative values too ) ... if you can't conclude whats wrong post the output images
  4. replace vec3 halfVector = normalize(lightVector + normalize(-position));   with vec3 viewVector = normalize(position - cameraPosition); vec3 halfVector = normalize(lightVector + viewVector);   like light position you also have to pass the camera position as a uniform to the shader remember you are doing lighting there in worldspace, not in viewspace. in viewspace the direction to the viewer would be -position     thx
  5. GL_FRAMEBUFFER_UNSUPPORTED is returned if the combination of internal formats of the attached images violates an implementation-dependent set of restrictions. https://www.opengl.org/sdk/docs/man3/xhtml/glCheckFramebufferStatus.xml   i'm not sure what is the problem here see for possible formats https://www.opengl.org/sdk/docs/man/html/glTexImage2D.xhtml   but anyway, you want 16 or 32 bit values for position and normals, also with 3 not 4 values glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, height, 0, GL_RGB, GL_FLOAT, NULL); // position, 3 float values glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, height, 0, GL_RGB, GL_FLOAT, NULL); // normals, 3 float values glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_FLOAT, NULL); // diffuse color, 3 float values, or 4 values with alpha (GL_RGBA)   for more details consider my deferred rendering code https://github.com/oggs91/CGUE2014-15/blob/master/src/DeferredPipeline.cpp line 333
  6. that's no opengl command ...  gl_createGBufTex(GL_TEXTURE2, GL_RGB32F, id_textures[GBUFFER_TEXTURE_TYPE_NORMAL], GL_RGB, screenWidth, screenHeight); // Normal could you provide sourcecode for this?    since you don't specifiy it in gl_createGBufTex the GL_FLOAT part may be missing
  7. as phil_t said ... i recommend to use RGB32F which means 32bit for each vector component glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, height, 0, GL_RGB, GL_FLOAT, 0);   usually color textures have a RGB or RGBA format, which provides only unsigned 8 bit per component
  8. normal transformation looks correct, if you do no scaling on the modelMat even the modelMat itself would be a proper transformation for normals but since you transformed them to worldspace colors should be consistent for surfaces which equal orientation, which is clearly not the case for your rendering of worldspace normal vectors - so as soon as you get some lighting expect it to be wrong on the tanks   try to render the lightDirs next, pls post the result :)
  9. your position and normal are vec4, what values do the w components have? this can affect the normalization of the normal maybe use vec3 n = normalize(normal.xyz) or change the texture lookup your calculations of diffuse and specular terms seem to be correct   i also think you dont transform your normals correctly on the tanks blue is up, on the floor green is up transform normals in the geometry pass by the inverse transpose of modelview matrix
  10. for example tonemapping shaders use this functionality to read the average luminance from the smallest mipmap level which is only 1x1 pixel
  11. essentially the sampler is what brings your texture from a raster image to a 2d parameterized texture space, so you can index your texture in the shader not with pixel positions but with a continuous floating point value in 2 axis in range [0,1]   ok, nice, but how do we determine what color is on position [0.234, 0.789] ? first of all we need the texture size lets assume it's [512, 512] [0.234, 0.789] * [512, 512] = [119.808, 403.968] okay ... but at this exact position is obviously no pixel going the simple way we can just use the NEAREST pixel position [120, 404]   well but that looks pretty crappy, especially if we zoom into the texture ... another possibility would be to interpolate between the 4 surrounding pixels [119, 403], [120, 403], [119, 404], [120, 404] this method is called bilinear interpolation   i already mentioned zooming into the texture ... this is called the magnification filter and this case can be perfectly handled with bilinear interpolation ... but now imagine the shown texture covers less pixels than in the original texture if we use nearest we only get the one pixel marked on the right, if we use bilinear interpolation we get 4 pixels ... but actually we need the pixels of the whole patch .. and somehow combine the colors on the left you can see the result with linear interpolation, pretty ugly because we dont use enough information from our texture, this effect is called aliasing   and finally this is where mipmapping steps in the mipmaps of a texture are downsampled versions of the original textures ( original is the bottom one ) each mip level has half it's size of the previous level   resume to the image from before, we have a big area in texel space we have to cover ... we can now choose an appropriate mip level from our texture pyramid depending on the size of the area in texture domain ... choosing colors from appropriate mipmaps leaves us with image (b) from before   but wait there is more! if two pixels in screenspace are now textured from two different mipmap levels we can get artifacts,  compare bilinear mipmap with trilinear mipmap   trilinear filtering solves our problem, it samples a second mipmap level and interpolates again linearily between the sampled colors from the two chosen mipmap levels   but wait ... there is even more if you still have not enough from this subject look into ripmapping and anisotropic filtering
  12. oh i didnt actually answer your question ...   as i explained in my previous post vec3(InverseViewMatrix * vec4(0.0, 0.0, 0.0, 1.0) is equal to the camera position in world space what you want is a directional vector pointing from the fragments worldspace position to the viewer (= camera position) which is computed by   vec3 viewDirection = normalize(cameraPosition - worldSpacePosition));
  13. first of all viewMatrix is a matrix that transforms from worldspace to camera space the inverse therefore transforms camera space to worldspace   which means you transform the coordinate (0,0,0) from camera to worldspace, and this is the camera position in world space coordinate system i usually just pass the camera position vec3 uniform to the shader which is much simpler and clearer   if this matrix multiplication is unclear to you it may be valuable todo the matrix multiplication once by hand, and you will see that multiplying with vec4(0,0,0,1) is same as extracting the translational part of the matrix
  14. diffuseReflection = attenuation * vec3(SunlightDiffuse) * vec3(DiffuseMeshColor) * max(0.0, dot(normalDirection, normalDirection));     max(0.0, dot(normalDirection, normalDirection)); <-- this should describe with a value from 0 to 1 how bright the surface is ( you compute the squared distance of the normalDirection, which should always evaluate to 1 )   replace with   max(0, dot(normalDirection, lightDirection))   if both vectors are normalized this gives you the cosine of the angle between the vectors     for testing i suggest to compute only finalColor = vec4(vec3(max(0, dot(normalDirection, lightDirection))), 1);
  15. i thought this a bit further... as you said the blur should be only applied to pixels with alpha=0 therefore would normalize the blur kernel with the sum of weights at positions where alpha != 0   if i apply the blur once i get a border of 1 pixel around my chart in the 1d case (with blur [0.5 1 0.5]) it would look like this:   so applying the "blur" multiple times with a fragment shader, eventually fills the whole texture