Shader question (because im rubbish at it)

   6536   12   1
User Avatar
Member
196 posts
Joined: July 2005
Offline
Hi,


This an opengl view of my pretty boxes. They're 25 nurbs primitives. I've coloured them using a point sop with their primitive number. I want to do the same thing in the vop builder and render it with mantra.

Its the importing of the primitive number that I cant do. The rest I can.

Thats easy right?

Thanks for any replies in advance

p.s. ive always put up with those weird cross hatching lines caused by insecting geometry. Is that unavoidable?
Edited by - Jan. 11, 2004 08:20:22
Henster
User Avatar
Member
7713 posts
Joined: July 2005
Offline
Not at Houdini right now but try putting in an AttribCreate SOP and then creating a float point attribute of size 1. Then put $PR for the first Value. Now import this attribute into your shader.
User Avatar
Member
196 posts
Joined: July 2005
Offline
Hi edward,

thanks for the reply.

$PR didn't work in the attribcreate sop for some reason. So, i used a point sop to do it instead. I've got the attribute. My main problem was getting that value in the vop builder?

ta
Henster
User Avatar
Member
7713 posts
Joined: July 2005
Offline
I think you put down a Parameter VOP and turn on the Export parameter. Make sure you name the parameter exactly the same as your point attribute.

As for AttribCreate, oops, $PR only works with primitive or vertex attributes. That's because a point may be shared by any number of primitives. So try using a Vertex attribute with AttribCreate.
User Avatar
Member
412 posts
Joined: July 2005
Offline
Henster,

I don't know exactly what you are going for, but i did a simple solution that may or may not work for you. I'm not getting the PR values in to vops, but i am coloring a grid of primitive spheres via point sop and $PR. I then am transferring that in to my shader built from vops.

My vop was just a lighting model into my Cf, and a parameter vop in to my diff of the lighting model. Created the shader. In my shader's diff parameters, I am channel referencing my point sop's color channels.

At the sop level after my point sop, i have appended an attribute sop that renamed Cd to Cf1 in the point tab and a shader after that. When I set my display to this, my opengl goes gray of course, but renders fine. You could keep the display on the point sop and the render on the shader sop.

Here is my opengl and mantra render… lemme know if this helps at all and i can upload the file if needed. like i said, very simple solution, so it may not be what you're looking for at all..

hth,

dave

opengl:



mantra:

Dave Quirus
User Avatar
Member
412 posts
Joined: July 2005
Offline
oh and btw.. those triangular hatching lines look like clipping plane issues to me.. try going to your display options->culling tab-> clipping planes. it's prob defaulted at .001… try .01 or .1 and see if that fixes it…
Dave Quirus
User Avatar
Member
196 posts
Joined: July 2005
Offline
thanks for the replies deecue,

I've managed to mess it up though.

I dont understand why you would rename Cd to Cf? I thought the colour would be coming from the channel referencing into the shader parameters.

Its just coming out grey on mine. :shock:
Henster
User Avatar
Member
196 posts
Joined: July 2005
Offline
I didnt see edwards post.

Looks like the paramter is coming in now.

But… its gone mental.
mantra:

VOPs:



whats that about?

thanks
Henster
User Avatar
Member
7713 posts
Joined: July 2005
Offline
Works for me. Do you have intersecting polygons? That would explain your opengl problems too. If you simply ran PolyExtrude on a Grid, make sure you do it based on an edge selection.
User Avatar
Member
412 posts
Joined: July 2005
Offline
you rename Cd to Cf1 because when you are adding color through the point sop, it is doing that through creating the Cd (i assume meaning color diffuse) attribute. But A Vex Surface Shader output VOP is based on creating the Cf1 attribute (Color Surface 1 I assume). So in order for your created shader to see the Cd information and apply it to it's surface color, you have to rename Cd to Cf1.

The only things that I know of that see Cd information is the already created Vex Layered Surface Shader and Vex Super Material Shader.
Dave Quirus
User Avatar
Member
412 posts
Joined: July 2005
Offline
here's a box version… also, i should probably note that I am doing my color randomization through an expression in the point sop rather than through vops.

opengl:



mantra:

Dave Quirus
User Avatar
Member
196 posts
Joined: July 2005
Offline
Hello again,

thanks very much for helping me. I'm just discovering how boring uploading these images is.

Anyway, I'm pretty sure that it isnt the geometry insecting that causing the problem since I seperated them using a primitive sop:




I noticed as well that the streaks of colour are the same as the main colour of the previous box (near left to far right).

I'm afraid they're not just extruded boxes. I've written an expression to wrap girds around the colums of a divided box.

This is a bizarre. But, this must be the most colourful thread to date! (i like deecue's ‘mantraed’ spheres)

Ta
Henster
User Avatar
Member
196 posts
Joined: July 2005
Offline
ok. I found out what was causing it. The boxes start life as meshes but later get converted to nurbs surfaces. If I bypass the convert sop or check ‘interpolate through hulls’ then it goes away. Looks like it was insecting as well after all. I was hoping changing the opacity or alpha would stop that. Apparently not.

Thanks anyway
Henster
  • Quick Links