Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


FXACE

Member Since 18 Sep 2009
Offline Last Active Feb 18 2013 04:06 AM

Posts I've Made

In Topic: Loading BMP but no color channels?

02 September 2012 - 05:18 PM

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?

In Topic: GLSL Fog

02 September 2012 - 05:10 PM

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.

In Topic: Picking

21 August 2012 - 07:13 PM

Well, I suggest you to use "color picking" if you planning (in near future) to pick objects with alpha testing.

Best wishes, FXACE.

In Topic: OpenGL and Desktop Composition on NVIDIA

21 August 2012 - 07:04 PM

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.

In Topic: GLSL automatic texture coordinated for cube

21 August 2012 - 06:43 PM

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.

PARTNERS