pass point color to the instanced geometry's shader

   7956   6   0
User Avatar
Member
2 posts
Joined:
Offline
Sorry, if this question is simple or over asked. ops: This is new to me.

I have a piece of geometry being instanced to a large field of points/particles. I wish to pass the color information of each individual point to the shader for the geometry.

Like many others, I have been working through the gnomon 101 DVD. After playing with and expanding to the ‘image to points to geometry’ lesson, the memory limitations of the copy SOP became an issue. If anyone can help - thanks! Have been wrestling with this for days.
User Avatar
Member
7715 posts
Joined: July 2005
Offline
I've attached a contrived example.

Good info on this can be found here:
http://www.odforce.net/wiki/index.php/MantraInstancing#Point_Instancing [odforce.net]

Another good, more complicated, and more commented example on something similar except with lights can be found in this thread (make sure you read to the end before downloading):
http://odforce.net/forum/index.php?showtopic=3969&st=0 [odforce.net]

Attachments:
instance_color.zip (34.0 KB)

User Avatar
Member
2 posts
Joined:
Offline
Thanks edward! Great link and a file too. And here I was almost ready to give up.
User Avatar
Member
509 posts
Joined: July 2005
Offline
hey Edward… many thanks for this.. i was also looking how to manipulate instanciated geometry's shaders.. but now I've got a question….

I guess the attribute called “vm_surface” is a sort of keyword.. since when i changed it .. no color was changed.. now… my question is.. where can I find help about this concept and the relative variables/attributes which can be overrided by instance and attributes?… for example.. i was trying to modify the teapot radius using the same way (opdef, which i also cant find any help page on it) and it isnt working… now… since “vm_surface” is neded to work for shader (i guess) .. where can I find the help on how I can also set others attribues to instances? (like in my case.. i wish to change come SOP parameters)..


cheers and thanks in advance.
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
User Avatar
Member
7715 posts
Joined: July 2005
Offline
The vm_surface attribute is used by mantra to determine which shaders to use for each primitive. It is generated by the Shader SOP. That's what the other Shader SOP in that file is used for. An easy way to determine (say via the geometry details view aka spreadsheet) what the shader string should be.
User Avatar
Member
523 posts
Joined: July 2005
Offline
Hello Edward,


I studied your file and for testing I disconnected the ShaderSOP (and even deleted it).
Now the Rendering seems to be the same , even without this ShaderSOP.
How can this vm_shader attr be created, and the result be the same ?


Using H8.1.625


many thanks,



bern
User Avatar
Member
7715 posts
Joined: July 2005
Offline
I'm not sure what you mean. The Shader SOP is not used for cooking at all. It's just there as a handy reference so that I can right-click on it and look at how it generated the vm_surface attribute values.
  • Quick Links