DAZ Script "Material Definition" [RiSpec Constant] Sample

Todo:
Concepts Covered
Description :

Below is the source for a script that builds the individual shader objects (DzRSLShader) used by the custom material class, DzShaderMaterial, to pass values to a given shader. Whether that be for a beauty pass shader, a simpler shader used for the shadow pass, a displacement shader used in several different passes, or some other purpose.

 
Concepts Covered :
  • DESCRIPTION NEEDED
 
Source : ./samples/shader swapping/scripts/support/RiSpec/shaderDefinitions/surface/
00001 // DAZ Studio version 3.0  filetype DAZ Script
00002 /**********************************************************************
00003     File: constantDef.dsa
00004 
00005     Copyright © 2002-2009 DAZ Productions. All Rights Reserved.
00006 
00007     This file is part of the DAZ Script Documentation.
00008 
00009     This file may be used only in accordance with the DAZ Script 
00010     license provided with the DAZ Script Documentation.
00011 
00012     The contents of this file may not be disclosed to third parties, 
00013     copied or duplicated in any form, in whole or in part, without the 
00014     prior written permission of DAZ Productions, except as explicitly
00015     allowed in the DAZ Script license.
00016 
00017     See http://www.daz3d.com to contact DAZ Productions or for more 
00018     information about DAZ Script.
00019 **********************************************************************/
00020 /*****************************
00021    Script globals
00022 *****************************
00023 "Material" - is a transient global variable provided by the interpreter
00024 when this script is called via DzShaderMaterial::setDefinitionFile()
00025 (which is also called by the overload constructor), that references the
00026 current DzShaderMaterial.
00027 *****************************/
00028 var oShader;
00029 
00030 /**********************************************************************/
00031 setBusyCursor();
00032 
00033 Material.setMaterialName( "RiSpec Constant" );
00034 
00035 oShader = new DzRSLShader;
00036 Material.addShader( oShader );
00037 oShader.setShaderType( DzRSLShader.Surface );
00038 oShader.setShaderFile( "RiSpec/constant" );
00039 oShader.setDefinitionFile( "support/RiSpec/shaderDefinitions/surface/constantSurf.dsa" );
00040 oShader.setActiveInShadowPass( true );
00041 
00042 clearBusyCursor();

Generated on Thu Sep 24 12:21:07 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.