Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

123 Neutral

About Oculus_Malus

  • Rank

Personal Information


  • Github
  1. Oculus_Malus

    Depth buffer texture

    Thanks, it was just a matter of Depth buffer values (zFar too high) even looking at objets near the user was too far !
  2. There are many way to free the cpu from processing your game loop. The idea is to give the control back to the OS after you're done updating your game. The easiest way is to process it only when theres an input (from the user, from internet, or any internal OS messages) Its good for card games and suchs, as you dont need to update while the user is idle (only for music or animations etc) You can also use a timer to call your game loop.. kinda not the best solution except for demos or screensavers ... The usual way is to use the Vertical-Sync (formely WaitRefresh) from the monitor. This way, your game give back the control to other process after the current screen have been updated, usually 60 times per seconds. Who you do that depends on what language and OS you are using.
  3. Hi, I've been looking for a way to get the depth buffer data as a texture to display. It seem that it isn't covered in my version of the red book neither on the opengl.org website. So far I have gathered lots of exemples from various applications and that's what I came up with. Texture initialization : glGenTextures(1, @T); glBindTexture(GL_TEXTURE_2D, T); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 256, 256, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, nil); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); After the actual scene is rendered (and before the gui) : glfinish; glBindTexture(GL_TEXTURE_2D, T); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, 256, 256, 0); Unfortunatly, it dosen't work. The texture is filled with white. Is there some specific extensions that I need to enable before using it ? or an extra twist of code that I missed somewhere? Thank you.
  4. Oculus_Malus

    programming games with Pascal.

    I dont know what your really want, but most game tutorial on gamedev.net and gametoturials.com can apply directly to pascal. The "game" in itself is independant of the language, only some use of the API will differs for calling conventions and such. If youre into opengl then NEHE also keep a pascal version of (mostly) all the tutorials or look for www.sulaco.co.za
  5. Oculus_Malus

    Spheremapping + Multitexturing

    I had this problem once, you have to set one texture as GL_Blend and set the color to 1,1,1,1 http://www.gamedev.net/community/forums/topic.asp?topic_id=284483 example of code in delphi : const Tex_Color : array[1..4] of glFloat = (1,1,1,1); //the texture unit used in the sphere mapping must be set that way : glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND ); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, @Tex_Color );
  6. Oculus_Malus

    Sph Mapping Blending

    nevermind :P i've figured it out myself for the record, the GL_TEXTURE1 (with sph mapping) must be set to GL_BLEND and the COLOR to [1,1,1,1] const Tex_Color : array[1..4] of glFloat = (1,1,1,1); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND ); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, @Tex_Color );
  7. Oculus_Malus

    Sph Mapping Blending

    somewhere in the initialization : glActiveTexture(GL_TEXTURE1); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); in the render : glActiveTexture(GL_TEXTURE0); glenable(gl_texture_2d); glbindtexture(gl_texture_2d,texbase); glActiveTexture(GL_TEXTURE1); glenable(gl_texture_2d); glbindtexture(gl_texture_2d,texenv); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_S); glActiveTexture(GL_TEXTURE0); glcolor4f(1,1,1,1); glbegin(gl_quads); glnormal3f(0,0,1); gltexcoord2f(0,0); glvertex3f(0, 0, 0); gltexcoord2f(1,0); glvertex3f(64,0, 0); gltexcoord2f(1,1); glvertex3f(64,64, 0); gltexcoord2f(0,1); glvertex3f(0, 64, 0); glend; glActiveTexture(GL_TEXTURE1); glDisable(GL_TEXTURE_GEN_T); glDisable(GL_TEXTURE_GEN_S); gldisable(gl_texture_2d); glActiveTexture(GL_TEXTURE0); gldisable(gl_texture_2d); theres an image of what it currently looks like and what I want: [Edited by - Oculus_Malus on November 24, 2004 9:42:02 AM]
  8. Oculus_Malus

    Sph Mapping Blending

    I'm trying to use multitexturing to draw a rifle with a base texture and a "chrome" sphere mapping ontop so it look all shiny. my problem is that the sphmap layer filter-out the underlaying texture instead of adding itself. (black color will not let anything show so its only black, and bright spots only reveal the base texture) is there a way to use blending or different textures modes to do this ? thanks.
  9. I just want to know the difference between the opengl 1.3 Multitexturing functions and the ARB functions. and why is there 2 set on seemingly identical multitex functions ? Thanks
  10. The half-life/cs multiplayer models have a LOT of differents humanoid animations and I'm pretty sure there is some kind of 3ds plug-in to load them. ( but you have to decompile them so .... anyway everyone have half-life :P ).
  11. Oculus_Malus

    Particle demo test

    about 390-400fps on my P3-800 / GF3-ti200 interesting fire effects !
  12. I think you'll have to calculate the basic memory usage that your prog. take then add the memory youre using.... could give strange result but its the easyest way (somwhat arbitrary). for the cpu just find a way to get the amount of time spent in the main loop / time spend outside the loop. Maybe the internal clock are also standard in linux but i have absolutly no idea :P
  • 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!