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.


Topics - kryx

Pages: [1]
1
Java / Android
« on: June 16, 2014, 10:41:22 pm »
Hi,

Shall JSFML be available for IOS and Android soon? I've read that should be come^^

Thanks

2
Graphics / RenderTexture and Shapes: Fantoms Pixels
« on: May 22, 2014, 10:08:50 am »
Helllo!

I have a problem when I use 2 RenderTexture and a CircleShape.
If I draw the on the first RenderTexture, this on the second RenderTexture and then on the screen and if I move the Circle, I obtain som pixels where the circle was and shouldn't be.

I use the last version of sfml 32 bits. I'm on Windows 7 and I use a Nvidia 650M GT (up-to-date). I have tried with last sdk and last version of github. I don't have tried with 64 bits version.

Here is my code:

#include "stdafx.h"
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(500, 500), "SFML works!");
        sf::RenderTexture t1,t2;
        sf::Sprite s1,s2;
    sf::CircleShape shape(10.f);
    shape.setFillColor(sf::Color::Green);

        t1.create(500,500);
        t2.create(500,500);
        s1.setTexture(t1.getTexture());
        s2.setTexture(t2.getTexture());

        int i = 5;

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

                t1.clear();
                t2.clear();
                t1.draw(shape);
                t1.display();
                t2.draw(s1);
                t2.display();

                i += 5;
                shape.setPosition(i,0);

        window.clear();
        window.draw(s2);
        window.display();
    }

    return 0;
}
 

and the result:



Thanks a lot!

3
Java / Use Shader With Text
« on: May 12, 2014, 11:20:19 pm »
Hi,

First: sorry for my bad English^^

Here is my problem: I would like to enable antialiasing on renderTexture. It seems to be impossible. So, Laurent Gomila say me to use shaders.
But they don't work...
I test with that shader:

uniform sampler2D texture;
uniform float blink_alpha;

void main()
{
    vec4 pixel = gl_Color;
    pixel.a = blink_alpha;
        gl_FragColor = pixel;
}

And here is my shader loading:

public static Shader FXAA;
if (!Shader.isAvailable()) {
        Log.OutError("Impossible de prendre en charge les shader...");
}
                       
FXAA = new Shader();
Path ShaderPath = FileSystems.getDefault().getPath("blink.frag");
FXAA.loadFromFile(ShaderPath, Shader.Type.FRAGMENT);
FXAA.setParameter("blink_alpha", 125);

RenderTexture.draw(obj, new RenderStates(FXAA));

But i get a black screen. Without shader, all is fine.
If I use the shader test of jsfml :

void main()
{
    //Compute level of gray
    float gray = dot(gl_Color.rgb, vec3(0.299, 0.587, 0.114));

    //Write destination color
    gl_FragColor = vec4(gray, gray, gray, gl_Color.a);
}

I get this: All is good, but not the text:



Really thanks to you to help me...

Pages: [1]