Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

182 Neutral


  • Rank
  1. Hello anyone! I wish to know: what difference between windows dynamic link libraries and linux shared objects? Does linux objects have entry points like DLLs (BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID data))? How to access public functions of lib.so? Thanks forward, for any reply!
  2. FXACE


    Shows a level of my knowledge in programming (games, graphics)
  3. Did you use shaders (if yes, post here what that shader does) or such things like "glEnable(GL_TEXTURE_2D)" at texture slot which was binded in? Does this "Texture" class support for loading bmp files?
  4. FXACE

    GLSL Fog

    Hello Madd, 1. Why are you doing glFog<..> calls if you don't use "gl_Fog" structure in your fragment shader? BUILD-IN UNIFORM: // // Fog // struct gl_FogParameters { vec4 color; float density; float start; float end; float scale; // 1.0 / (gl_Fog.end - gl_Fog.start) }; uniform gl_FogParameters gl_Fog; 2. (checked only your linear fog): In glFog<...> parameters (start,end) are in view space, while in your shader, looks like, screen space. 3. "mix" function description: float mix (float x, float y, float a) vec2 mix (vec2 x, vec2 y, float a) vec3 mix (vec3 x, vec3 y, float a) vec4 mix (vec4 x, vec4 y, float a) vec2 mix (vec2 x, vec2 y, vec2 a) vec3 mix (vec3 x, vec3 y, vec3 a) vec4 mix (vec4 x, vec4 y, vec4 a) Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of vectors x and y using the vector a. The value for a is not restricted to the range [0,1]. In this case, you will receive inverse of expecting result (flip "fog_color"<->"color")... 4. gl_FragCoord.z is already divided to gl_FragCoord.w by OpenGL and clamped to [0,0 .. 1.0] (glDepthRange parameters)... Hope, this helps you... Best wishes, FXACE.
  5. FXACE


    Well, I suggest you to use "color picking" if you planning (in near future) to pick objects with alpha testing. Best wishes, FXACE.
  6. Weird applications like Desktop Composition. Sometimes appears this issue even without these applications. It looks like when calling SwapBuffers(HDC) shows a result of previous (SwapBuffers(HDC) call, in other words - previous frame). There are two ways I know that might be able to solve this: 1. Add flag PFD_SWAP_COPY to PIXELFORMATDESCRIPTOR.dwFlags; 2. Do update screen twice per frame: // [start of frame] DrawSceneToFBO(); /* back buffer */ GoToScreenFBO(); DrawBackBufferToScreen(); /* draws a quad with back buffer texture into screen */ SwapBuffers(hDC); DrawBackBufferToScreen(); /* draws a quad with back buffer texture into screen */ SwapBuffers(hDC); // [end of frame] (Looks ugly but works for me) Best wishes, FXACE.
  7. You can use GL_EXT_draw_instanced extension for that. Just send matrices (transforms of your cubes) to shader and a number of instance objects you need to render. Best wishes, FXACE.
  8. You need to update your projection matrix on "screen size change" event: (for example) /* void onScreenSizeChange(int width, int height) { */ // width, height - new screen size glViewport(0, 0, width, height); // using classic OpenGL glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(width*-0.5,width*0.5,height*-0.5,height*0.5,-1,1); /* modify values here as you need */ glMatrixMode(GL_MODELVIEW); /* } */ So, when you apply this code, on any screen dimensions you will receive quadratic tiles. Best wishes, FXACE.
  9. #define true bool(rand()%2)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!