Hi, here a simple shader example tutorial. With this code we'll realize a lambert shader with 3 custom parameter: diffuse color, texture color, opacity. Here the code with some comment due to explain all the lines. \\definition of the shader tipe "surface" and the name. Between the brackets there's the parameter, one of color type, one of string type and one of float type. surface Lambert(color diffuseColor=color(1,0,0); string colorTexture=""; float opacity=1) { \\definition of the texture projection coordinates in world space point worldP = transform("world",P); \\function to normalize vector normal normal Nn = normalize(N); \\with this function we normalize the vector for pointing to the camera eye ("I") vector Nf = faceforward(Nn,I); \\definition of a texture file with path passed by ...
tips, techniques, tutorial and other about BIM