Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualstefthedrummer

Posted 02 July 2013 - 02:21 PM

Ok, now I tried these functions:

texelFetch(texture, coord, level);
textureLod(texture, coord, level);

and I also set my filters via "glTexParameter()" to

MAG -> GL_LINEAR
MIN -> GL_LINEAR_MIPMAP_NEAREST

but all I get is black pixels.

 

 

I'am absolutely shure that my textures are all-right, because when I render them with with:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);

It views the right level. (I have different colors on each level of my test texture).

		OpenGL.setTexture(0, texture); //(texture unit, textureHandle)
		OpenGL.setProgram(blitProgram);

		blitProgram.setInt("level", level);

		OpenGL.setDepthTest(false);

		glBegin(GL_QUADS);
		glVertexAttrib2f(1, 0.0f, 0.0f);
		glVertexAttrib3f(0, left, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 0.0f);
		glVertexAttrib3f(0, right, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 1.0f);
		glVertexAttrib3f(0, right, top, 0.0f);
		glVertexAttrib2f(1, 0.0f, 1.0f);
		glVertexAttrib3f(0, left, top, 0.0f);
		glEnd();

		OpenGL.setDepthTest(true);
#version 420 core

in  vec2 passCoord;

out vec3 outColor;

uniform sampler2D source;
uniform int       level;

void main()
{
	outColor = textureLod(source, passCoord, level).rgb + vec3(0.1f);
}

#version 420 core

in vec3 inPos;
in vec2 inCoord;
out vec2 passCoord;

void main()
{
	gl_Position = vec4(inPos, 1.0f);

	passCoord = inCoord;
}

Thanks in advance


#7stefthedrummer

Posted 02 July 2013 - 02:20 PM

Ok, now I tried these functions:

texelFetch(texture, coord, level);
textureLod(texture, coord, level);

and I also set my filters via "glTexParameter()" to

MAG -> GL_LINEAR
MIN -> GL_LINEAR_MIPMAP_NEAREST

but all I get is black pixels.

 

 

I'am absolutely shure that my textures are all-right, because when I render them with with:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);

It views the right level. (I have different colors on each level of my test texture).

		OpenGL.setTexture(0, texture); //(texture unit, textureHandle)
		OpenGL.setProgram(blitProgram);

		blitProgram.setInt("level", level);

		OpenGL.setDepthTest(false);

		glBegin(GL_QUADS);
		glVertexAttrib2f(1, 0.0f, 0.0f);
		glVertexAttrib3f(0, left, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 0.0f);
		glVertexAttrib3f(0, right, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 1.0f);
		glVertexAttrib3f(0, right, top, 0.0f);
		glVertexAttrib2f(1, 0.0f, 1.0f);
		glVertexAttrib3f(0, left, top, 0.0f);
		glEnd();

		OpenGL.setDepthTest(true);
#VERTEX SHADER
#version 420 core

in vec3 inPos;
in vec2 inCoord;
out vec2 passCoord;

void main()
{
gl_Position = vec4(inPos, 1.0f);

passCoord = inCoord;
}

#FRAGMENT SHADER
#version 420 core
 
in  vec2 passCoord;
 
out vec3 outColor;
 
uniform sampler2D source;
uniform int       level;
 
void main()
{
outColor = textureLod(source, passCoord, level).rgb + vec3(0.1f);
}

 

Thanks in advance


#6stefthedrummer

Posted 02 July 2013 - 02:20 PM

Ok, now I tried these functions:

texelFetch(texture, coord, level);
textureLod(texture, coord, level);

and I also set my filters via "glTexParameter()" to

MAG -> GL_LINEAR
MIN -> GL_LINEAR_MIPMAP_NEAREST

but all I get is black pixels.

 

 

I'am absolutely shure that my textures are all-right, because when I render them with with:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);

It views the right level. (I have different colors on each level of my test texture).

		OpenGL.setTexture(0, texture); //(texture unit, textureHandle)
		OpenGL.setProgram(blitProgram);

		blitProgram.setInt("level", level);

		OpenGL.setDepthTest(false);

		glBegin(GL_QUADS);
		glVertexAttrib2f(1, 0.0f, 0.0f);
		glVertexAttrib3f(0, left, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 0.0f);
		glVertexAttrib3f(0, right, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 1.0f);
		glVertexAttrib3f(0, right, top, 0.0f);
		glVertexAttrib2f(1, 0.0f, 1.0f);
		glVertexAttrib3f(0, left, top, 0.0f);
		glEnd();

		OpenGL.setDepthTest(true);
#VERTEX SHADER
#version 420 core

in vec3 inPos;
in vec2 inCoord;
out vec2 passCoord;

void main()
{
gl_Position = vec4(inPos, 1.0f);

passCoord = inCoord;
}

#FRAGMENT SHADER
#version 420 core
 
in  vec2 passCoord;
 
out vec3 outColor;
 
uniform sampler2D source;
uniform int       level;
 
void main()
{
outColor = textureLod(source, passCoord, level).rgb + vec3(0.1f);
}

Thanks in advance


#5stefthedrummer

Posted 02 July 2013 - 02:19 PM

Ok, now I tried these functions:

texelFetch(texture, coord, level);
textureLod(texture, coord, level);

and I also set my filters via "glTexParameter()" to

MAG -> GL_LINEAR
MIN -> GL_LINEAR_MIPMAP_NEAREST

but all I get is black pixels.

 

 

I'am absolutely shure that my textures are all-right, because when I render them with with:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);

It views the right level. (I have different colors on each level of my test texture).

		OpenGL.setTexture(0, texture); //(texture unit, textureHandle)
		OpenGL.setProgram(blitProgram);

		blitProgram.setInt("level", level);

		OpenGL.setDepthTest(false);

		glBegin(GL_QUADS);
		glVertexAttrib2f(1, 0.0f, 0.0f);
		glVertexAttrib3f(0, left, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 0.0f);
		glVertexAttrib3f(0, right, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 1.0f);
		glVertexAttrib3f(0, right, top, 0.0f);
		glVertexAttrib2f(1, 0.0f, 1.0f);
		glVertexAttrib3f(0, left, top, 0.0f);
		glEnd();

		OpenGL.setDepthTest(true);
#VERTEX SHADER
#version 420 core

in vec3 inPos;
in vec2 inCoord;
out vec2 passCoord;

void main()
{
gl_Position = vec4(inPos, 1.0f);

passCoord = inCoord;
}

#FRAGMENT SHADER
#version 420 core in vec2 passCoord; out vec3 outColor; uniform sampler2D source; uniform int level; void main() { outColor = textureLod(source, passCoord, level).rgb; }

Thanks in advance


#4stefthedrummer

Posted 02 July 2013 - 02:19 PM

Ok, now I tried these functions:

texelFetch(texture, coord, level);
textureLod(texture, coord, level);

and I also set my filters via "glTexParameter()" to

MAG -> GL_LINEAR
MIN -> GL_LINEAR_MIPMAP_NEAREST

but all I get is black pixels.

 

 

I'am absolutely shure that my textures are all-right, because when I render them with with:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);

It views the right level. (I have different colors on each level of my test texture).

		OpenGL.setTexture(0, texture); //(texture unit, textureHandle)
		OpenGL.setProgram(blitProgram);

		blitProgram.setInt("level", level);

		OpenGL.setDepthTest(false);

		glBegin(GL_QUADS);
		glVertexAttrib2f(1, 0.0f, 0.0f);
		glVertexAttrib3f(0, left, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 0.0f);
		glVertexAttrib3f(0, right, bottom, 0.0f);
		glVertexAttrib2f(1, 1.0f, 1.0f);
		glVertexAttrib3f(0, right, top, 0.0f);
		glVertexAttrib2f(1, 0.0f, 1.0f);
		glVertexAttrib3f(0, left, top, 0.0f);
		glEnd();

		OpenGL.setDepthTest(true);

#VERTEX SHADER
#version 420 core
 
in vec3 inPos;
in vec2 inCoord;
out vec2 passCoord;
 
void main()
{
gl_Position = vec4(inPos, 1.0f);
 
passCoord = inCoord;
}
 

#FRAGMENT SHADER
#version 420 core in vec2 passCoord; out vec3 outColor; uniform sampler2D source; uniform int level; void main() { outColor = textureLod(source, passCoord, level).rgb; }

 

Thanks in advance


#3stefthedrummer

Posted 02 July 2013 - 02:16 PM

Ok, now I tried these functions:

texelFetch(texture, coord, level);
textureLod(texture, coord, level);

and I also set my filters via "glTexParameter()" to

MAG -> GL_LINEAR
MIN -> GL_LINEAR_MIPMAP_NEAREST

but all I get is black pixels.

 

 

I'am absolutely shure that my textures are all-right, because when I render them with with:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level);

It views the right level. (I have different colors on each level of my test texture).

 

 

Thanks in advance


PARTNERS