Really..really..new at this

Really..really..new at this

Post by Scott Yanagid » Mon, 23 Sep 1996 04:00:00



Okay, here goes... Im a student and saw  BMRT on the net a while ago. I know renderman
would be great to know..for employment purposes and Id just like to know it. I have read
...(somebody's) book  on procedural texturing..And it was pretty deep. For me anyway.
Idont know C or C++ or any programming language, but want to learn. Im in school in
Seattle for computer animation and design graphics. But they dont teach that at my
school. Anyway, I am poor so I would like to use BMRT. I have all the stuff to install
Linnux on my system but would like to know a few things b4 I do.  If I use BMRT can I
get animations with it or just stills? I use 3ds4 and Animation master..Animation Master
outputs  RIB filess but 3ds does not.  Can I get a translator for my 3ds files to render
them with BMRT? And last question.. Do I need to know C++ to use BMRT? It would probably
be useful I know..but I also have school and work to deal with. Well..if anyone would
like to answer a newbie here's questions Id appreciate it. Then maybe I can take part in
these discussions too! *grin* Anyway..
                        Thanx!!

ps.  Can I write and compile C with Linux? or do I need to buy something else?

 
 
 

Really..really..new at this

Post by MarshRo » Mon, 23 Sep 1996 04:00:00


Quote:>>I use 3ds4 and Animation master..Animation Master

outputs  RIB filess but 3ds does not.<<

Don't count on AM's rib files.  They're incompatible with PRMan.  As I
understand it BMRT should work like PRMan enabling you to send it any rib
file for rendering.

To change the subject:

I've been trying to enhance the specularity in a shader I'm writing in
order to approximate a wet look.  My approach was to use an illuminance
statement and run the return value through a spline function that would
either dampen or raise it.  I'm getting really bad artifacts, however.  My
suspicion is that the Color intensity is pushed out of displayable range.
Are there any suggestions on how to proceed.

Marshall Ross

 
 
 

Really..really..new at this

Post by Larry Gri » Mon, 23 Sep 1996 04:00:00




>I've been trying to enhance the specularity in a shader I'm writing in
>order to approximate a wet look.  My approach was to use an illuminance
>statement and run the return value through a spline function that would
>either dampen or raise it.  I'm getting really bad artifacts, however.

Post the shader!  I'm sure lots of folks would be interested in the
approach, and maybe somebody can spot the cause of the artifacts.

        -- lg

--
Larry Gritz


 
 
 

Really..really..new at this

Post by MarshRo » Tue, 24 Sep 1996 04:00:00


I found the cause of the artifacts--I forgot to assign a value to one of
the color variables when I declared it.  However, I'm still not getting
the result I seek.  I send the dot product of N and H to my spline filter,
but the highlighting occurs on the wrong angles of the objects.  Any
ideas.

#define WIDESPECULAR   clamp(.5- specDrop,0,1)
#define MEDIUMSPECULAR   clamp(.65 - specDrop,0,1)
#define NARROWSPECULAR   clamp(.8 - specDrop,0,1)
#define VERRYNARROWSPECULAR  clamp(.95 - specDrop,0,1)
#define EXTREMESPECULAR   clamp(1 - specDrop,0,1)

float
specularRampIntensity (float angle, specDrop)
{
  return float spline (angle, 0, 0, WIDESPECULAR, MEDIUMSPECULAR,
   NARROWSPECULAR,VERRYNARROWSPECULAR, EXTREMESPECULAR,
EXTREMESPECULAR,1,1);

Quote:}

surface
GeneralTextureMap (
   float Ka = .5;
   float Ks = .5;
   float Kd = .5;
   float ColorMapScale = 1;
   float BumpMapScale = 1;
   float SpecularMapScale = 1;
   float roughness = .5;
   color specularcolor = color(1,1,1);

   string BumpColorRamp = "no";
   float BumpColorRampMix = 0;
   color DarkColor = color(0,0,0);
   color MediumColor = color(.5,.5,.5);
   color LightColor = color(1,1,1);

   string BumpMap = "";
   string ColorMap = "";
   string SpecularMap = "";

   float ColorMapsCoord = 0;
   float ColorMaptCoord = 0;
   float BumpMapsCoord = 0;
   float BumpMaptCoord = 0;
   float SpecularsCoord = 0;
   float SpeculartCoord = 0;

   float ColorHVRatio = 1;
   float BumpHVRatio  = 1;
   float SpecularHVRatio = 1;

   string FlipsBump = "no";
   string FliptBump = "no";  
   string FlipsColor = "no";
   string FliptColor = "no";
   string FlipsSpecular = "no";
   string FliptSpecular = "no";

   float BumpAmplitude = 1;
   float SpecularDropOff = .5;

   string BumpTiling = "yes";
   string ColorTiling = "yes";
   string SpecularTiling = "yes";

   )
{

 float colors1Coord = ColorMapsCoord;
 float colors2Coord = ColorMapsCoord + ColorMapScale;
 float colort1Coord = ColorMaptCoord;
 float colort2Coord = (ColorMaptCoord + ColorMapScale) * ColorHVRatio;
 float bumps1Coord = BumpMapsCoord;
 float bumps2Coord = BumpMapsCoord + BumpMapScale;
 float bumpt1Coord = BumpMaptCoord;
 float bumpt2Coord = (BumpMaptCoord + BumpMapScale) * BumpHVRatio;
 float speculars1Coord = SpecularsCoord;
 float speculars2Coord = SpecularsCoord + SpecularMapScale;
 float speculart1Coord = SpeculartCoord;
 float speculart2Coord = (SpeculartCoord + SpecularMapScale) *
SpecularHVRatio;

 float bumps;
 float bumpt;
 float colors;
 float colort;
 float speculars;
 float speculart;

 point Nf;
 color Ct = color (1,1,1);
 float bumpValue = 0;
 float KsMapped = Ks;
 float NdotH;
 point H;
 float specularFactor;
 color colorRampColor = color(0,0,0);  /*Here was the artifact
      problem, originally I didn't assign a value to this variable*/
 float bumpRampMix = 0;

(more)...............>>>>>>>>

 
 
 

Really..really..new at this

Post by MarshRo » Tue, 24 Sep 1996 04:00:00


(continued)
 /*transform P and N to object space*/
 P = transform("object",P);
 N = transform("object",N+point"object"(0,0,0));

 if (BumpMap != "") {
  bumps = (s-bumps1Coord)/(bumps2Coord-bumps1Coord);
  bumpt = (t-bumpt1Coord)/(bumpt2Coord-bumpt1Coord);

  if ((FlipsBump == "yes") || (FlipsBump == "Yes")) {
   bumps = 1-bumps;
   }
  if ((FliptBump == "yes") || (FliptBump == "Yes")) {
   bumpt = 1-bumpt;
   }

  bumpValue += float texture(BumpMap [0] ,bumps,bumpt);

  if ((BumpTiling == "no") || (BumpTiling == "No")) {
   if ((bumps<0) || (bumps>1) || (bumpt<0) || (bumpt>1)) {
    bumpValue = 0;
    }
   }
  if ((BumpColorRamp == "yes") || (BumpColorRamp == "Yes")) {
   colorRampColor = spline(bumpValue, DarkColor,DarkColor,MediumColor,
         LightColor, LightColor);
   bumpRampMix = BumpColorRampMix;
   }

  }

 if (ColorMap != "") {
  colors = (s-colors1Coord)/(colors2Coord-colors1Coord);
  colort = (t-colort1Coord)/(colort2Coord-colort1Coord);

  if ((FlipsColor == "yes") || (FlipsColor == "Yes")) {
   colors = 1-colors;
   }
  if ((FliptColor == "yes") || (FliptColor == "Yes")) {
   colort = 1-colort;
   }

  Ct =  color texture(ColorMap ,colors,colort);
  if ((ColorTiling == "no") || (ColorTiling == "No")) {
   if ((colors<0) || (colors>1) || (colort<0) || (colort>1)) {
    Ct = Cs;
    }
   }
  }
  Ct = mix(Ct, colorRampColor, bumpRampMix);

 if (SpecularMap != "") {
  speculars = (s-speculars1Coord)/(speculars2Coord-speculars1Coord);
  speculart = (t-speculart1Coord)/(speculart2Coord-speculart1Coord);

  if ((FlipsSpecular == "yes") || (FlipsSpecular == "Yes")) {
   speculars = 1-speculars;
   }
  if ((FliptSpecular == "yes") || (FliptSpecular == "Yes")) {
   speculart = 1-speculart;
   }

  KsMapped =  float texture(SpecularMap [0] ,speculars,speculart) * Ks;
  if ((SpecularTiling == "no") || (SpecularTiling == "No")) {
   if ((speculars<0) || (speculars>1) || (speculart<0) || (speculart>1)) {
    KsMapped = Ks;
    }
   }
  }
  P += normalize(N) * bumpValue * BumpAmplitude;
 /*transform P back to current space*/
  P = transform("object","current",P);
 /*normalize the vector*/
  N = calculatenormal (P);
  N = normalize (N);
  Nf = faceforward (N,I);
  illuminance(P,Nf,PI) {
   H = (normalize(I) + normalize(L))/2;
   NdotH = (Nf.H);
   specularFactor = specularRampIntensity (NdotH, SpecularDropOff);
  }

 Oi = Os;
 Ci = Os * Cs * Ct * ((Ka * ambient() + diffuse(Nf) * Kd) +
         (Ks  * specularcolor * specularFactor));

Quote:}

 Thanx for the help

Marshall

 
 
 

Really..really..new at this

Post by Florian Ha » Wed, 25 Sep 1996 04:00:00


Dcade I, Tridi de Vendmiaire de l'Anne 205 de la Rvolution


> I have all the stuff to install Linnux on my system but would like
> to know a few things b4 I do.  If I use BMRT can I get animations
> with it or just stills?

Yes. BMRT comes with two prewiewers (one for wireframes and one using
shaded polygons) and can render animations. In this case it produces a
TIFF-file for every frame, so be sure to have a large harddisk.

You need some other programs to transform this collection of images
into something else, like an MPEG-movie. To be true, Linux isn't the
optimal multimedia production environment.

Quote:> ps. Can I write and compile C with Linux? or do I need to buy
> something else?

Yes, of course. The GNU C-compiler is an essential part of any Linux-based
installation.

Florian.

PS: And please don't use Netscape as a newsreader, it produces ugly,
unreadable output since it ignores the recommended maximum line length
for usenet messages.

--

*----------------------------------------------------------------------*
  ``Der W?schetrockner flirtet mit dem Video und sendet Strahlen aus
    -- ein elektronischer Zoo.''        Spliff, ``Computer sind doof''

 
 
 

Really..really..new at this

Post by Larry Gri » Wed, 25 Sep 1996 04:00:00




> I've been trying to enhance the specularity in a shader I'm writing in
> order to approximate a wet look.  My approach was to use an illuminance
> statement and run the return value through a spline function that would
> either dampen or raise it.

I took a look at the shader, and the illuminance loop doesn't make much
sense.  Here's what you had:

  illuminance(P,Nf,PI) {
   H = (normalize(I) + normalize(L))/2;
   NdotH = (Nf.H);
   specularFactor = specularRampIntensity (NdotH, SpecularDropOff);
  }

This is strange for several reasons.  First, you're gathering light
from the entire sphere, not just the hemisphere above the point
(that's what the PI means).  Also, you're taking H to be
(norm(I)+norm(L))/2, which is not right -- it's actually
norm(norm(-I)+norm(L)).  You're simply assigning specularFactor,
rather than adding for each light -- so at the end, it will only have
the value for the last light examined.  And Finally, you're not
incorporating Cl in any way, so there's no notion of how much light
the source is actually supplying.

So to start, here's how I'd write the illuminance loop:

  point V;
  color specularFactor;
  N = normalize (N);
  Nf = faceforward (N,I);
  V = normalize (-I);
  specularFactor = 0;
  illuminance(P,Nf,PI/2) {
      H = normalize(V + normalize(L));
      NdotH = (Nf.H);
      specularFactor += Cl * [some function] ;
  }
  Oi = Os;
  Ci = Os * Cs * Ct * ((Ka * ambient() + diffuse(Nf) * Kd) +
         (Ks  * specularcolor * specularFactor));

Now, the original question is, what should [some function] be to
give a "wet" look.  I'm not sure what that is, but I'm guessing
that a "sharper" specular falloff would give that "glistening"
appearance.  Not just a smaller value for roughness, either, which
would make the highlight smaller, but not change its "shape".
I'd stick with something simple -- smoothstep.  Try this:

  illuminance(P,Nf,PI/2) {
      H = normalize(V + normalize(L));
      NdotH = (Nf.H);
      specularFactor += Cl * smoothstep (.7, .9,
                                         pow (max (0, NdotH), 1/roughness));
  }

where roughness is somewhere around 0.015.

Maybe this isn't quite "wet" so much as "porcelain", but perhaps the
idea is coming across.

        -- lg

--
Larry Gritz


 
 
 

1. really really really stupid question

Hi all.
I know this is a stupid question, but here goes anyways.
How do I create a new layer and new adjustment layer in PhotoImpact 5?
I've already dug through both the manual and ulead's web site and I
could find anything on them.

TIA.
Justin

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Steamer plug-in in 5.5

3. really really good stuff

4. Bitmap to Cursor function

5. PS CS2 Print w preview Position <<ANNOYING, REALLY REALLY ANNOYING

6. PS Image Looks Different With Explorer ???

7. Really, really good keystroke idea!!

8. miro rainbow si in other mac?

9. Really really basic question on convolution

10. really really fast :) texture mapping, a suggestion...

11. Really Really Basic OpenGL Question

12. Skinned subdivs are really, really slow.