Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

GLSL point sprites with lights

General discussion about anything TouchDesigner

GLSL point sprites with lights

Postby vince79 » Wed Feb 13, 2019 12:39 pm

Hi all,

I would like to know if it's possible to apply lighting to point sprites rendered from a glsl shader?
I know it is possible to do it with a geometry shader using billboards but I wonder if I can do it using only vertex+pixel shader.

Something that would look like this:

Code: Select all
vec4 texture = texture(sSpriteTex, pointUVs);
fragColor = TDOutputSwizzle(texture * color);


Thank you very much!

Vincent
Attachments
pointcloud_sprites_light.4.toe
(14.44 KiB) Downloaded 72 times
Last edited by vince79 on Wed Feb 13, 2019 12:51 pm, edited 1 time in total.
vince79
 
Posts: 14
Joined: Wed Jun 08, 2011 3:12 am

Re: GLSL point sprites with lights

Postby malcolm » Wed Feb 13, 2019 12:50 pm

Ya, you just feed whatever normal you want into the lighting functions and you'll get a value for it. So if you want them to be lit as if it's facing the camera, send the world normal that is facing the camera into it
User avatar
malcolm
Staff
 
Posts: 4400
Joined: Tue Nov 13, 2007 1:11 am

Re: GLSL point sprites with lights

Postby vince79 » Sat Feb 16, 2019 5:37 pm

Thank you!
vince79
 
Posts: 14
Joined: Wed Jun 08, 2011 3:12 am


Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: No registered users and 21 guests