Author Topic: Fragment shader - color by position  (Read 2373 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Fragment shader - color by position
« on: July 08, 2012, 09:35:45 pm »
Is possible to get color in fragment shader from current image buffer by position? I can't find any info about it on the internet...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Fragment shader - color by position
« Reply #1 on: July 08, 2012, 09:43:01 pm »
No, that's not possible...it would ease a lot of things, but it's not possible... :(
« Last Edit: July 08, 2012, 09:47:06 pm by EgonOlsen »

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Fragment shader - color by position
« Reply #2 on: July 08, 2012, 10:48:26 pm »
So, if I want this effect (windows in rooms, which deforming image), I have to render scene to target, render depth, render final effect and somehow checking it with depth? Damn it, I want just color from image buffer :-\

edit: something like portal, which is in this tech demo ... http://www.youtube.com/watch?v=Q9MEvP_RXCY
« Last Edit: July 08, 2012, 10:51:09 pm by Thomas. »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Fragment shader - color by position
« Reply #3 on: July 08, 2012, 10:55:42 pm »
Something like that...i don't know exactly how to do this, but you have no access to the framebuffer in the shader.

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Fragment shader - color by position
« Reply #4 on: July 08, 2012, 11:23:01 pm »
This is effect, that I mean (distortion is from texture), on photo. I'll try to do transparent glass.