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

Author Topic: Fragment shader render-to-texture not working as expected  (Read 8406 times)

0 Members and 1 Guest are viewing this topic.

Conduit

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Fragment shader render-to-texture not working as expected
« Reply #15 on: March 21, 2015, 07:20:05 pm »
Figured that was the case, since the documentation doesn't mention anything. Bummer! Doubt I have the OpenGL know-how to extend anything but the most simple portions of the SFML graphics library at present... For now I guess I'll just have a little extra trig in my shaders. Thanks Laurent.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Fragment shader render-to-texture not working as expected
« Reply #16 on: March 21, 2015, 11:46:08 pm »
It would be LOVELY if I could add polar coordinates to simplify a couple shader calculations I have planned.

My NetEXT project (port of Thor) contains a PolarVector which supports conversion to SFML's vector type. See my signature for links.

https://bitbucket.org/zsbzsb/netext/src/c4192b6723eafea9eb8913634cfda7b98b17dd72/NetEXT/Vectors/PolarVector.cs?at=master
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Conduit

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Fragment shader render-to-texture not working as expected
« Reply #17 on: March 24, 2015, 06:59:11 pm »
As expected, the problem was due to my noobishness with regard to OpenGL/GLSL. I'd assumed (in error) that texture coordinates being uploaded in pixels inferred that GLSL wouldn't follow the typical 0...1 standards for texture sampling. Kinda silly in retrospect. Output is a little stuttered, but I'm also using Intel HD Graphics on a three-year-old laptop, so whatevs.

zsbzsb and Laurent - I won't say my introduction to GLSL was painless by any means, but with your help it was at least palatable. Many thanks! :)

Sample output using exponential zoom, warping, color dampening, and a square for input is attached. Unfortunately I can't upload a video displaying how awesome this looks (re: Intel HD Graphics).
« Last Edit: March 24, 2015, 07:01:46 pm by Conduit »