Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Set Custom Attributes in GLSL Mat for Render Pick?

Send us your requests for enhancements (RFEs)

Set Custom Attributes in GLSL Mat for Render Pick?

Postby lucasm » Thu Jan 10, 2019 6:10 pm

I am attempting to set Custom render pick attributes via a GLSL Mat, but seem unable to do so.

Image

I've read through https://docs.derivative.ca/Write_a_GLSL_Material and noticed that this struct:

Code: Select all
TDPickVertex {
   vec3 sopSpacePosition;
   vec3 worldSpacePosition;
   vec3 camSpacePosition;
   vec3 sopSpaceNormal;
   vec3 worldSpaceNormal;
   vec3 camSpaceNormal;
   vec3 uv[1];
   flat int instanceId;
   vec4 color;
} vTDPickVert;


can be modified after calling TDWritePickingValues(); like this:

Code: Select all
TDWritePickingValues();
vTDPickVert.sopSpacePosition = newPosition;
vTDPickVert.worldSpacePosition = uTDMats[TDCameraIndex()].world * vec4(newPosition, 1.0);
vTDPickVert.camSpacePosition = uTDMats[TDCameraIndex()].worldCam * vec4(newPosition, 1.0);


However I can't find a syntax or convention for addressing those custom attributes..

Is it possible to address them at all as in, they are simply not documented? or is this not possible through GLSL materials?

I should note, I am able to still pass custom attributes through the glslMAT via the point SOP pre shader.. that works just fine, so the data is getting through, I just can't set it manually.
User avatar
lucasm
 
Posts: 232
Joined: Sat Apr 28, 2012 7:55 pm
Location: Dallas, TX

Re: Set Custom Attributes in GLSL Mat for Render Pick?

Postby malcolm » Mon Jan 14, 2019 7:27 pm

Sorry, those end up in
Code: Select all
vTDCustomPickVert
instead of
Code: Select all
vTDPickVert
. I'll update the help
User avatar
malcolm
Staff
 
Posts: 4236
Joined: Tue Nov 13, 2007 1:11 am

Re: Set Custom Attributes in GLSL Mat for Render Pick?

Postby lucasm » Mon Jan 14, 2019 7:34 pm

Awesome thanks for the tip!
User avatar
lucasm
 
Posts: 232
Joined: Sat Apr 28, 2012 7:55 pm
Location: Dallas, TX


Return to Wishlist and RFEs

Who is online

Users browsing this forum: No registered users and 5 guests