Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Question to GLSL Basic Procedure

Still a little green? Ask your beginner's questions here

Re: Question to GLSL Basic Procedure

Postby raganmd » Fri May 26, 2017 7:24 pm

Ahhhh.

Apologies. The error in these networks is the use of TDOutputSwizzle(), which is a new method in touch099 that ensures comparability between mac and windows versions. The issue is that this function doesn't exist in 088, hence the error you're seeing. This can be resolved by removing that call, and changing the output of fragColor to be equal to color - the vec4 that's holding the color information form the previous operations.

Here's a fixed version of these examples to be only in 088:

Glsl_yox_quest_pointIndex_as_uv_088.tox
(3.72 KiB) Downloaded 23 times

Glsl_yox_quest_pointcoord_uvs_gradient_088.tox
(3.6 KiB) Downloaded 24 times

Glsl_yox_quest_pointcoord_uvs_088.tox
(3.57 KiB) Downloaded 22 times
raganmd
 
Posts: 961
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: Question to GLSL Basic Procedure

Postby elburz » Sat May 27, 2017 3:33 pm

Thanks for the examples, Matthew. We should def just quit our jobs and sit on the beach writing educational content!

Hopefully those examples solve the question!
--
Elburz Sorkhabi
Creative + Technology
nVoid Art-Tech Limited
http://nvoid.com
elburz
 
Posts: 1844
Joined: Fri Jun 01, 2012 6:55 pm
Location: Toronto, Canada

Re: Question to GLSL Basic Procedure

Postby hellochristhompson » Tue Aug 08, 2017 7:45 am

Hey Matthew,

Thanks for the point sprite examples. I'm learning a bunch from them. One thing I've gotten stuck on is how to scale the sprites relative to the camera distance. I know this should be fairly simple but I just can't crack it. Any help would be greatly appreciated.
hellochristhompson
 
Posts: 9
Joined: Tue Mar 21, 2017 7:52 pm

Re: Question to GLSL Basic Procedure

Postby raganmd » Tue Aug 08, 2017 12:45 pm

hey there hellochristhompson,

Probably the smart way to go about this would be to pass in a uniform vec3 that represented the xyz location of the camera. From there you could write your vertex shader so that your gl_PointSize was derived from the length of the point's position to the camera - that's assuming that you potentially want every point. You could also pass in a float for the distance between a single point and the camera - and then treat this as a scaler.

Does that help?
raganmd
 
Posts: 961
Joined: Thu Mar 28, 2013 5:21 am
Location: San Francisco, CA

Re: Question to GLSL Basic Procedure

Postby hellochristhompson » Sun Aug 13, 2017 1:01 am

Thanks Matthew. That works a treat. I was having issues until I realised you could grab the camera's world origin with an Object CHOP. Now it's working smooth as butter. Thanks again!
hellochristhompson
 
Posts: 9
Joined: Tue Mar 21, 2017 7:52 pm

Previous

Return to Beginners

Who is online

Users browsing this forum: Google [Bot], lrtrime and 9 guests