www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Thomas. on July 08, 2012, 09:35:45 pm

Title: Fragment shader - color by position
Post by: Thomas. 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...
Title: Re: Fragment shader - color by position
Post by: EgonOlsen 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... :(
Title: Re: Fragment shader - color by position
Post by: Thomas. on July 08, 2012, 10:48:26 pm
So, if I want this (http://www.youtube.com/watch?v=XMHC1num23I) 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
Title: Re: Fragment shader - color by position
Post by: EgonOlsen 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.
Title: Re: Fragment shader - color by position
Post by: Thomas. 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.

(http://s17.postimage.org/uwknec9dn/Screenshot_2012_07_08_23_16_33.jpg) (http://postimage.org/image/uwknec9dn/)