Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

replace texelFetchBuffer example with texelFetch

Discuss help and learning documents. Submit your ideas for future tutorials and documents

replace texelFetchBuffer example with texelFetch

Postby landonth » Mon Mar 18, 2019 4:03 pm

I suspect this is why several people started using this deprecated function.
https://docs.derivative.ca/GLSL_MAT#Par ... ays_1_Page

Expand Array Type choparraytype0 [+] to see it

Texture Buffer texturebuffer - A Texture Buffer is declared and used like this:
Code: Select all
 // A texture buffer will also be a vec4, but only the first 1, 2, 3 or 4 component will contain data, depending on the type you choose.            
 uniform samplerBuffer arrayName;            
 // sampler the value at index 10. It be default returns a vec4, so change it to a vec3 in this example using .xyz            
 vec3 aValue = texelFetchBuffer(arrayName, 10).xyz;

See last line of the code block
Attachments
texelFetchBuffer_docs.jpg
texelFetchBuffer_docs.jpg (169.2 KiB) Viewed 1531 times
User avatar
landonth
 
Posts: 79
Joined: Tue Sep 09, 2014 11:15 pm

Re: replace texelFetchBuffer example with texelFetch

Postby malcolm » Fri Mar 22, 2019 11:26 am

This is fixed, thanks for the note!
User avatar
malcolm
Staff
 
Posts: 4427
Joined: Tue Nov 13, 2007 1:11 am

Re: replace texelFetchBuffer example with texelFetch

Postby landonth » Tue Apr 02, 2019 6:03 pm

Awesome, thank you.

Also jmt4zj / pointshader / Jonathan Thompson was just looking for this documentation, but it's a bit hidden here as you know... maybe it could also be added or moved to the Write a GLSL Material document as that seems to be the "one-sheet" for in depth reference and code examples like this?
I recall having some difficulty finding it myself also. Up to you all how you see it best organised, just sharing our experience FYI. Cheers.
User avatar
landonth
 
Posts: 79
Joined: Tue Sep 09, 2014 11:15 pm


Return to TouchDesigner Documentation

Who is online

Users browsing this forum: No registered users and 1 guest