Renderman Constant Variable?

dodgerrecordsdodgerrecords Posts: 123

Hello, don't know if I'm in the right place. I am currently messing around with programming renderman shaders. I am wanting to make it so that I can set a variable, and change the variable as the shader cycles across each point of the surface.

Say I have variable color(1,0,0); and each time the shader cycles it would execute color=color+color;

Anyone know how to do this? Thanks!

Comments

  • almahiedraalmahiedra Posts: 1,352
    edited December 1969

    You can use boolean operators and for loops to change sections on surface.

  • dodgerrecordsdodgerrecords Posts: 123
    edited December 1969

    gilikshe said:
    You can use boolean operators and for loops to change sections on surface.


    But how do you cycle through each position? If I do a for loop is it automatically going to start cycling through each pixel? Or Is there some global variable I need to increment?
  • almahiedraalmahiedra Posts: 1,352
    edited December 1969

    You don't have acces to one position. All is changed at same time unless restrictions are applied.

    s and t, are variables for surface. P is points variable. You can establish conditions based on the values of these variables, like:

    Ci = ( t < 0.5) && (t >0.2) ? 1 : 0;

    then any section of surface with t between 0.2 and 0.5 gets white while the remaining surface gets black.

    You can create arrays of values for restrictions and use for-loop for apply it. Of course, the matter is what you want do and how translate it in an iterative process

    If you want random colors you can use a noise function on the other hand.

Sign In or Register to comment.