HolyDel

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

139 Neutral

About HolyDel

  • Rank
    Newbie

Personal Information

  1. OpenGL Seams revisited

    may be problem in texture? are you sure that all white pixels with alpha less in you discard value in fragment shader?
  2. also on NVidia cards packed vertices (normalized byte e.g.) rendering faster float vertices. its benchmark: [url="http://axelynx.googlecode.com/files/test_packed_normals.zip"]http://axelynx.googl...ked_normals.zip[/url] on my notebook (9600M GT, P8400 2x2.26GHz) this scene (if all hebemissions in frame) rendered with fps: fpp - 218 (interleaved arrays) GL 3.3 forward context: float - 185 packed - 255 (code: [url="http://code.google.com/p/axelynx/source/browse/trunk/axelynx/axelynx/axelynx/source/CSurface.cpp#402"]http://code.google.c...Surface.cpp#402[/url]) on ATI card i don't see diffirents with packed/unpacked vertices attribs also with packed vertices DIPs (glDraw...) take more time that unpacked.
  3. OpenGL 2D in Opengl 3.2?

    code to build ortho matrix: [font=Monaco,][quote][color="#666600"]void [/color][color=#660066]Ortho[/color][color=#666600](float *m, [/color][color=#000088]float[/color][color=#000000] left[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] right[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] top[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] bottom[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] znear[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] zfar[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]{[/color][color=#000000] [/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] tx [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]-[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]right [/color][color=#666600]+[/color][color=#000000] left[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]/[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]right [/color][color=#666600]-[/color][color=#000000] left[/color][color=#666600]);[/color][color=#000000] [/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] ty [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]-[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]top [/color][color=#666600]+[/color][color=#000000] bottom[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]/[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]top [/color][color=#666600]-[/color][color=#000000] bottom[/color][color=#666600]);[/color][color=#000000] [/color][color=#000000] [/color][color=#000088]float[/color][color=#000000] tz [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]-[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]zfar [/color][color=#666600]+[/color][color=#000000] znear[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]/[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]zfar [/color][color=#666600]-[/color][color=#000000] znear[/color][color=#666600]);[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] Identity(m); //identity matrix[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] m[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]2.0f[/color][color=#000000] [/color][color=#666600]/[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]right [/color][color=#666600]-[/color][color=#000000] left[/color][color=#666600]);[/color][color=#000000] [/color][color=#000000] m[/color][color=#666600][[/color][color=#006666]12[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] tx[/color][color=#666600];[/color][color=#000000] [/color][color=#000000] m[/color][color=#666600][[/color][color=#006666]5[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]2[/color][color=#000000] [/color][color=#666600]/[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]top [/color][color=#666600]-[/color][color=#000000] bottom[/color][color=#666600]);[/color][color=#000000] [/color][color=#000000] m[/color][color=#666600][[/color][color=#006666]13[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] ty[/color][color=#666600];[/color][color=#000000] [/color][color=#000000] m[/color][color=#666600][[/color][color=#006666]10[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]-[/color][color=#006666]2[/color][color=#000000] [/color][color=#666600]/[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]zfar [/color][color=#666600]-[/color][color=#000000] znear[/color][color=#666600]);[/color][color=#000000] [/color][color=#000000] m[/color][color=#666600][[/color][color=#006666]14[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] tz[/color][color=#666600];[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color][color=#000088]return[/color][color=#000000] m[/color][color=#666600];[/color][color=#000000] [/color][color=#666600]}[/color][/quote][color=#666600][/color][/font]
  4. OpenGL GL coordinates

    Hey, Mybowlcut. glOrtho(0, window_w, window_h, 0, -1, 1); if you use 1 as near plane and 2 as far plane, then z coordinates in you gl primitives must be in this range (1..2). also, may use: glVertex2f(x,y); or glVertex2i(x,y); for drawing gl primitives.
  5. OpenGL GL coordinates

    my engine 2d mode initialization: void Start2D(int sizex, int sizey) { glViewport(0,0,sizex,sizey); glDisable (GL_CULL_FACE); glDisable ( GL_DEPTH_TEST ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho(0, sizex, sizey,0,-1,1); glTranslatef(0.375f,0.375f,0.0f); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); } opengl use as (0,0) left botom corner of viewport. if you want use left TOP corner as (0,0) then you need use "glOrtho(0, sizex, sizey,0,-1,1);" not "glOrtho(0, sizex, 0,sizey,-1,1);". "glTranslatef(0.375f,0.375f,0.0f);" used for right processed subpixel coordinates sorry for bad english.
  6. OpenGL Surface structure

    for fastest geometry output may use: 0) Use VBO. on heavy surfaces its may 1) 16 bits indices (on several videocards 32 bits working ~30% slower) 2) optimize indices for post TnL cash (use NVTRiStrip for example) its my realisation of surface class in my engine: http://code.google.com/p/sigelengine/source/browse/trunk/surface.cpp may be its not beautiful architecture, but working very fast (faster other engine, Irrlicht, Blitz3D, OGRE, etc) MakeVBO on 857 line Draw on 1281 line
  7. 2d light maps

    you may draw lights in screen-size texture with blending settings: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_MAX); and draw screen-size quad with this texture and blending settings: glBlendFunc(GL_ONE, GL_ONE); glBlendEquation(GL_FUNC_ADD); or glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); glBlendEquation(GL_FUNC_ADD); (this will also obscure the picture, not only clarify) \\sorry for bad english [Edited by - HolyDel on April 2, 2009 11:55:51 PM]