Marc Posted October 4, 2004 Share Posted October 4, 2004 I think this should go in the rendering forum. Anyway, even this is relating to my hair topic, I thought it would be generic enough to stand on its own. So it's my understanding that the instancing will pick up the shader attributes from the points that the instance will be applied to, assuming there are any. Failing that it will use the object level shader from the points that will define the instances. Correct? My question is this. I want to pick up a point attribute from my instance points (not the geometry being instanced) and use it to define something in my shader which will then be applied to the instances. This should be possible correct? So if I have a size 3 float attribute (or a "vector") named foo() which is assigned to each point. I then use a parameter VOP inside my shader to import the foo variable and assign it to diff. If we say that the value of foo is .5,.5,.5 across all the points, then diff should be a nice flat grey colour. sadly, it isn't. Also if I print out the value of foo from the parameter VOP then it prints out 0,0,0.. so it obvously isn't picking up the attribute Is there something wrong with my logic? Thanks M Quote Link to comment Share on other sites More sharing options...
Marc Posted October 5, 2004 Author Share Posted October 5, 2004 :tumbleweed: Quote Link to comment Share on other sites More sharing options...
crunch Posted October 5, 2004 Share Posted October 5, 2004 :tumbleweed: 14125[/snapback] It's my understanding that the only attributes picked up from the points which are being instanced upon are any point shaders. All other attributes seem to be ignored. Quote Link to comment Share on other sites More sharing options...
Jason Posted October 5, 2004 Share Posted October 5, 2004 It's my understanding that the only attributes picked up from the points which are being instanced upon are any point shaders. All other attributes seem to be ignored. 14126[/snapback] Oh, I wish that mantra could pick up any attributes on the instance point - this would make varying the look of instances sooo much easier. Its really difficult right now unless you only have one shader on your instance - which doesn't happen very often. Almost all the time the object you're instancing (the "instancee") has several shaders defined - like a flower would have petals and leaf shaders and a bird would have feathers, body and and feet shaders. If mantra could read an arbitrary attribute, like, say, id - then your shaders could be written to pick this up and vary each instance accordingly. The same is true for overriding shader parameters like "diff" and so on. Right now you have to either generate a few unique instancees and then assign them to the instancer somehow. Quote Link to comment Share on other sites More sharing options...
Marc Posted October 5, 2004 Author Share Posted October 5, 2004 May I be the first to say that that sucks ass. :thumbdown: What I need to do is have each hair pick up the colour from a texture map, so that I can have varying colours over the surface of my character. Pre-defining certain hair colours is just not going to cut it... poo. M P.S. Actually, I remember coming up against this on Day After Tomorrow, but since I had no time to look into it, all I did was define a bunch of varying objects. Guess I unknowingly took the only path available. Quote Link to comment Share on other sites More sharing options...
Jason Posted October 5, 2004 Share Posted October 5, 2004 May I be the first to say that that sucks ass. :thumbdown: What I need to do is have each hair pick up the colour from a texture map, so that I can have varying colours over the surface of my character. Pre-defining certain hair colours is just not going to cut it... P.S. Actually, I remember coming up against this on Day After Tomorrow, but since I had no time to look into it, all I did was define a bunch of varying objects. Guess I unknowingly took the only path available. 14131[/snapback] You might find the instancing is overkill for hair. It might very well be heavier on mantra to instance every hair than have a copySOP populate it. I'd just CopySOP it and have fun with point attributes unconstrained. Quote Link to comment Share on other sites More sharing options...
Marc Posted October 5, 2004 Author Share Posted October 5, 2004 ?? Seems like a perfect use for instancing to me. To get a nice fur look, I may need upwards of 200 000 hairs. At 4 points each, thats a bunch of geometry. Having said that though it may be the only option. Since instancing seems crippled in such a nice way, its not really worth the effort. bah humbug M Can you tell I'm not having a good day? Quote Link to comment Share on other sites More sharing options...
Jason Posted October 5, 2004 Share Posted October 5, 2004 ??Seems like a perfect use for instancing to me. To get a nice fur look, I may need upwards of 200 000 hairs. At 4 points each, thats a bunch of geometry. Having said that though it may be the only option. Since instancing seems crippled in such a nice way, its not really worth the effort. bah humbug M Can you tell I'm not having a good day? 14134[/snapback] Oh, duh - You're using "Point Instancing", right? You're not setting the instance attribute, etc - you're just setting it in the Object. Yeah, ok.. I was just thinking that if you were instancing, it needs N, v (and up if you want good motionblur) and long text string pointing to the instance in the instance attribute. This seems like a lot more data than just 4 points with velocity attributes . Quote Link to comment Share on other sites More sharing options...
Marc Posted October 5, 2004 Author Share Posted October 5, 2004 ok then, after being set straight by Jason and and unnamed benefactor , it seems that copying the hairs is the way to go. Way more control too.. With that being said, off I go. Lets hope I get something today. Quote Link to comment Share on other sites More sharing options...
meshsmooth Posted October 5, 2004 Share Posted October 5, 2004 Rangi was mentioning something about being able to call a operator from within mantra and someone was talking about instancing a custom Object Type at render time with its attributes from within the render. Would any of those methods be apropret? http://odforce.net/forum/index.php?showtop...ree++instancing So you make a hair OT and use that... not that i am coming from a stand point of knowledge, that is kind of the vibe that i got from that rhythm & hues page recently posted. http://www.rhythm.com/~ivan/hairRender.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.