Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ic5y

Pages: [1]
1
Graphics / Re: Shader performance
« on: December 08, 2013, 06:11:18 pm »
http://pastebin.com/9trE982C <- here is my code

The code of the shader:
uniform sampler2D texture;

const vec4 res1 = vec4(1.0, 1.0, 0.3, 1.0);
const vec4 res2 = vec4(0.0, 0.0, 0.66666, 1.0);

void main()
{
    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
    gl_FragColor = pixel.a * res1 + (1.0 - pixel.a) * res2;
}
 

The shader examples are running smooth, maybe the old and slow VGA is the problem.

2
Graphics / Re: Shader performance
« on: December 02, 2013, 12:58:45 am »
But could it be a shader problem? On the other hand, I haven't tried yet, what happens if I use vbos, because I just couldn't drop GLEW into the project. ><

EDIT: I modified the shader not to use branching, only got +1 FPS.

3
Graphics / Re: Shader performance
« on: November 30, 2013, 06:24:46 pm »
I packing the vec3 into a vec4, because I had some uniforms to modify the color of the fonts. But I commented them out, and deleted from the source. On the other hand, I'm checking if the texture is transparent(255,0,255 color), and I set that pixel to the background color (now vec3(0.0, 0.0, 0.66666)), then set the other pixels color to the other color.

4
Graphics / Shader performance
« on: November 30, 2013, 06:03:38 pm »
Hello!

I have an interesting problem, maybe it's just my old video card. I'm trying to create a custom font renderer (using sf::Sprite with shaders). The problem is that if I draw 3700 sprite without shaders, it runs at 300-400 FPS, but if I turn on the very basic shaders the FPS drops to 9. The vertex shader does nothing, but on the fragment, I just do some simple calculation.

uniform sampler2D texture;

void main()
{
    vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
    if(pixel == vec4(1.0, 0.0, 1.0, 1.0))
    {
        pixel = vec4(vec3(0.0, 0.0, 0.66666), 1.0);
    }
    else
    {
        pixel = vec4(vec3(1.0, 1.0, 0.3), 1.0);
    }
    gl_FragColor = pixel;
}

Any idea? I thought about the lot of texture swap, but then it won't run with 300 - 400 fps without shaders.

Pages: [1]