Created
December 3, 2008 17:26
-
-
Save syoyo/31622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Macintosh-3: $ cat input.sl | |
surface | |
matte(float Ka = 1.0; float Kd = 1.1;) | |
{ | |
normal Nf = faceforward(normalize(N), I); | |
Oi = Os; | |
Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf)); | |
} | |
Macintosh-3: $ ./lslc input.sl | |
// [AST] = [ShaderFunc Surface "matte" [FormalDecl TyFloat "Ka" (Just (F 1.0)),FormalDecl TyFloat "Kd" (Just (F 1.1))] [Def TyNormal "Nf" (Just (Call TyUndef "faceforward" [Call TyUndef "normalize" [Var TyUndef "N"],Var TyUndef "I"])),Assign TyUndef (Var TyUndef "Oi") (Var TyUndef "Os"),Assign TyUndef (Var TyUndef "Ci") (BinOp TyUndef OpMul [BinOp TyUndef OpMul [Var TyUndef "Os",Var TyUndef "Cs"],BinOp TyUndef OpAdd [BinOp TyUndef OpMul [Var TyUndef "Ka",Call TyUndef "ambient" []],BinOp TyUndef OpMul [Var TyUndef "Kd",Call TyUndef "diffuse" [Var TyUndef "Nf"]]]])]] | |
surface matte(float Ka, float Kd) { | |
normal Nf = faceforward(normalize(N), I); | |
Oi = Os; | |
Ci = ( ( Os * Cs ) * ( ( Ka * ambient() ) + ( Kd * diffuse(Nf) ) ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment