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 - xoxalph

Pages: [1]
1
Graphics / Re: Squares when drawing SFML graphics with OpenGL
« on: October 23, 2014, 05:05:10 pm »
Sorry, but I manged to fix it. My texture states were a bit jumbled up, so changing it to
glActiveTexture(GL_TEXTURE0);
made it work fine.

Thanks anyway. No need to keep this thread open.

2
Graphics / Re: Squares when drawing SFML graphics with OpenGL
« on: October 23, 2014, 05:02:01 pm »
I'm more comfortable using OpenGL for most purposes. I used two FBOs before, and it worked just fine. Now I'm using three, though it started glitching before that.

3
Graphics / Squares when drawing SFML graphics with OpenGL
« on: October 23, 2014, 04:54:37 pm »
I'm trying to draw a texture and a string after rendering the OpenGL stuff. It worked fine before and then it suddenly started glitching at one point. I use FBOs for post-processing, so the final step is just rendering an FBO texture on screen. I don't see what the problem could be here, any lingering OpenGL states that aren't pushed?

This is the code I'm testing with:

sf::RenderWindow window(sf::VideoMode(WIDTH, HEIGHT, 32),
              "Game", sf::Style::Titlebar | sf::Style::Close, sf::ContextSettings(32)
               );

...

glUseProgram(0);
glBindVertexArray(0);
glActiveTexture(0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindTexture(GL_TEXTURE_2D, 0);

window.pushGLStates();

sf::Sprite spr;
spr.setPosition(sf::Vector2f(10.f, 10.f));
spr.setScale(sf::Vector2f(2.f, 2.f));
spr.setTexture(TEX[3]);
text.setString("test string 1");
text.setPosition(sf::Vector2f(10.f, 10.f));
window.draw(spr);
window.draw(text);

window.popGLStates();
window.display();
 

And this is what I get:



Thanks.

4
Graphics / Trouble with render texture and OpenGL
« on: September 24, 2014, 05:29:15 pm »
Hi. I'm trying to implement an in-game camera similar to Fatal Frame. What I figured out is first drawing the scene in front of the camera, and then the scene the player actually sees.

I have a render texture that everything is drawn to, which I use for post-processing. What I do is copy the texture data from it to a regular sf::texture right after rendering the camera scene, and then I use that sf::texture as the camera screen for this sort of effect. http://i.imgur.com/1pvB9Tp.gif

Anyway, copying the texture data of the render texture really slows everything down. If I disable it, the FPS jumps from ~200 to ~1500. I tried simply using the render texture itself as a camera screen, which just leads to artifacts. http://i.imgur.com/4yy54h5.png
Is there a better way to do this?

Thanks

EDIT: Never mind, I'll just use multiple FBOs for it. Solved.

Pages: [1]