displacement

displacement

Post by Sam Jorgense » Thu, 24 Oct 1996 04:00:00



Uh-oh another stupid "could have been answered by the RC book"!!!
Here we go :

How do I displace a model using the alpha information from a texture?
How do I actually apply a texture to model?

Sorry about the stupid questions!!
--
                 "Sam-Michael Myers/Ozzy Osbourne-Jorgensen"
            "Of all the things I've lost I miss my mind the most!"
                            -Ozzy Osbourne-                

                        Here's my stupid homepage
                http://www.nectar.com.au/~mmyers/lordoflight.html

 
 
 

displacement

Post by Antoine Du » Fri, 01 Nov 1996 04:00:00


: Uh-oh another stupid "could have been answered by the RC book"!!!
: Here we go :

: How do I displace a model using the alpha information from a texture?
: How do I actually apply a texture to model?

The texture() function can actually take channels.  Thus, if you have a
four channel .tx file, you can set

  alpha = texture(texturename [3], s, t);

The parameter "texturename" is a string parameter that is passed to the
shader via the RIB file.

-- Antoine

: Sorry about the stupid questions!!
: --
:                  "Sam-Michael Myers/Ozzy Osbourne-Jorgensen"
:             "Of all the things I've lost I miss my mind the most!"
:                             -Ozzy Osbourne-                
:              
:                       Here's my stupid homepage
:               http://www.nectar.com.au/~mmyers/lordoflight.html

--
_______________________________________________________________________________


_______________________________________________________________________________

 
 
 

displacement

Post by Larry Gri » Wed, 06 Nov 1996 04:00:00




Quote:>> : Uh-oh another stupid "could have been answered by the RC book"!!!

Not stupid at all, but yes, it certainly would be answered by _RC_.

Quote:>I am sorry but I need to know how I can displace a model if I have .tiff
>file and BMRT. What calls do I need to use to use the texture and what
>format do I need to convert the image into??

Here's a simple displacement shader that makes dents based on an image
texture:

        displacement
        emboss (float Km = 0.05;
                string texturename = "";)
        {
          if (texturename != "") {
              P -= Km * (float texture(texturename)) * normalize(N);
              N = calculatenormal (P);
            }
        }

For BMRT, the texture just needs to be a TIFF file (RGB or greymap are
fine, but palette images are not).  For PRMan, it needs to be Pixar's
proprietary texture format (one can convert tiff to textures using txmake).

        -- lg

--
Larry Gritz                                     Pixar Animation Studios