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

Author Topic: Smoothly rendered vertexArrays?  (Read 3636 times)

0 Members and 1 Guest are viewing this topic.

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Smoothly rendered vertexArrays?
« on: May 01, 2012, 09:29:49 pm »
I was doing this http://drilian.com/2009/02/25/lightning-bolts/ using vertexArray for rendering, but I ran into a problem: vertexArrays don't seem to render smoothly.

Is there any way to fix this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Smoothly rendered vertexArrays?
« Reply #1 on: May 01, 2012, 09:39:25 pm »
What do you mean? Anti-aliased? Anti-aliasing must be enabled globally when you create the window (in the context settings).
Laurent Gomila - SFML developer

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Smoothly rendered vertexArrays?
« Reply #2 on: May 01, 2012, 10:08:15 pm »
Precisely.
I tried using context setting, but it didn't seem to work. VertexArray stayed alialised.

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Smoothly rendered vertexArrays?
« Reply #3 on: May 01, 2012, 10:32:52 pm »
Nevermind, fixed it.
It seems I just had to setSmooth to true on the texture itself.

But thanks anyway :)

Jove

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • http://www.jestofevekites.com/
Re: Smoothly rendered vertexArrays?
« Reply #4 on: May 01, 2012, 10:44:17 pm »
Dang, that's a nice effect!  :)
{much better code}

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Smoothly rendered vertexArrays?
« Reply #5 on: May 01, 2012, 10:53:59 pm »
Amazing oO

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Smoothly rendered vertexArrays?
« Reply #6 on: May 04, 2012, 01:51:25 am »
Nevermind, fixed it.

Or not. I can't seem to turn on the antialiasing.
I'm setting up the window as follows:
sf::RenderWindow window(sf::VideoMode(1024,512),"Lights Test",sf::Style::Default,sf::ContextSettings(0,0,4,2,0));

But everything is still aliased.

Any idea on what am I doing wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Smoothly rendered vertexArrays?
« Reply #7 on: May 04, 2012, 08:01:09 am »
You said that texture smoothing solved your problem, and now you're trying to enable anti-aliasing. Would you mind explaining what happened in the meantime?

And we still don't know what you want: anti-aliasing (smooth edges) or texture smoothing (smooth textured pixels).

By the way, if you're on Linux, anti-aliasing is broken (see the issue tracker).
Laurent Gomila - SFML developer

Vovosunt

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Smoothly rendered vertexArrays?
« Reply #8 on: May 04, 2012, 01:14:38 pm »
Actually, I wanted both, smooth textures and antialiasing.
But mostly antialiasing, because smoothing the texture makes it really blurred out(works well when the sprite is rotated, but otherwise doesn't look too good).


 

anything