www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: lawless_c on June 16, 2014, 11:24:28 pm

Title: Can shaders be applied to textures?
Post by: lawless_c on June 16, 2014, 11:24:28 pm
I wanted to know this as id like to know if i't possible to apply shaders to textures such as for a UI, or something that will get placed on the framebuffer. The only way i can currently think of doing this might be to apply it to a flat mesh and have against the camera.
Title: Re: Can shaders be applied to textures?
Post by: lawless_c on June 17, 2014, 01:12:14 pm
I should specify why i want to know this. I'm curious is Signed Distance field fonts could be used to help build a UI.


Some links explaining how this works.

https://code.google.com/p/libgdx/wiki/DistanceFieldFonts

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch34.html

https://forum.libcinder.org/#Topic/23286000001127007

https://code.google.com/p/glyphy/

http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf


fonts

http://openfontlibrary.org/en/catalogue?view=&page=7
Title: Re: Can shaders be applied to textures?
Post by: EgonOlsen on June 18, 2014, 07:22:34 pm
You can't apply a shader to a texture, only to real geometry. But you can use an Overlay instead of the blit methods in FrameBuffer. You can get the Object3D that forms the Overlay and add a shader to that one.
I hope this helps, because i can't access your links ATM due to my slow mobile internet connection.
Title: Re: Can shaders be applied to textures?
Post by: lawless_c on June 19, 2014, 02:30:58 am
I'll give that shot , if I find something that works I'll report back what I got working here.