#*****************************************************************************
# Copyright 1986-2002 by mental images GmbH & Co.KG, Fasanenstr. 81, D-10623
# Berlin, Germany. All rights reserved.
#*****************************************************************************
# Author:	Thomas Driemeyer
# Created:	16.9.94
# Module:	shader
# Purpose:	.mi declarations for built-in Softimage shaders
#
# Exports:
#	soft_material		 material shader
#	soft_color		 2D color texture shader
#	soft_vector		 2D vector texture shader
#	soft_color_3d		 3D color texture shader
#	soft_vertex_color	 2D color texture shader, copies XYZ to RGB
#	soft_vertex_color_alpha	 2D color texture shader, calcs RGBA from XYZ
#	soft_vertex_color_alpha2 2D color texture shader, calcs RGBA from XYZ
#	soft_light		 all Softimage light types
#	soft_point		 (obsolete) point light source
#	soft_infinite		 (obsolete) infinite light source
#	soft_spot		 (obsolete) spot light source
#	soft_displace		 displacement shader
#	soft_staticblur		 displacement shader for static blur
#	soft_shadow		 shadow shader
#	soft_env_sphere		 environment shader
#	lens_depth_of_field	 depth-of-field lens shader
#	out_raisedcosine	 output filter
#
# History: 
#
# Description:
# Store this file in /usr/include/mi/softimage.mi, and use $include
# <softimage.mi> in every .mi file that uses any SOFTIMAGE shader.
#****************************************************************************/

min version "2.0.16.21"
max version "3.2.99"

#
# material
#

declare shader
	color "soft_material" (
		integer		"mode",	# 0=flat, 1=lambert, 2=phong, 3=blinn
		color		"ambient",
		color		"diffuse",
		color		"specular",
		color		"ambience",
		scalar		"shiny",
		scalar		"transp",
		scalar		"reflect",
		scalar		"ior",
		boolean		"sblur",
		scalar		"sblurdecay",
		boolean		"notrace",
		array light	"lights",
		array light	"difflights",
		array struct	"texture" {
			color texture	"map",
			integer		"space",
			integer		"mask",
			integer		"comp",
			integer		"method",
			scalar		"blend",
			scalar		"ambient",
			scalar		"diffuse",
			scalar		"specular",
			scalar		"transp",
			scalar		"reflect",
			scalar		"bump",
			scalar		"u_unit",
			scalar		"v_unit",
			scalar		"u_wrap",
			scalar		"v_wrap",
			boolean		"blackwhite"
		}
	)
	version 1
	apply material, volume, shadow, photon
end declare

declare shader
	"soft_material_photon" (
		integer		"mode",	# 0=flat, 1=lambert, 2=phong, 3=blinn
		color		"ambient",
		color		"diffuse",
		color		"specular",
		color		"ambience",
		scalar		"shiny",
		scalar		"transp",
		scalar		"reflect",
		scalar		"ior",
		boolean		"sblur",
		scalar		"sblurdecay",
		boolean		"notrace",
		array light	"lights",

		array struct	"texture" {
			color texture	"map",
			integer		"space",
			integer		"mask",
			integer		"comp",
			integer		"method",
			scalar		"blend",
			scalar		"ambient",
			scalar		"diffuse",
			scalar		"specular",
			scalar		"transp",
			scalar		"reflect",
			scalar		"bump",
			scalar		"u_unit",
			scalar		"v_unit",
			scalar		"u_wrap",
			scalar		"v_wrap",
			boolean		"blackwhite"
		}
	)
	version 1
	apply photon
end declare




#
# textures
#

declare shader
	color "soft_color" (
		color texture	"texture",
		integer		"repu",
		integer		"repv",
		boolean		"altu",
		boolean		"altv",
		boolean		"swap",
		scalar		"minu",
		scalar		"maxu",
		scalar		"minv",
		scalar		"maxv",
		transform	"transform",
		boolean		"u_torus",
		boolean		"v_torus",
		integer		"method"
	)
	version 1
	apply texture
end declare

declare shader
	color "soft_color_3d" (
		integer		"seq",
		integer		"type",		# 0=marble, 1=wood, 2=cloud
		scalar		"spacing",
		scalar		"angle",
		scalar		"strength",
		scalar		"power",
		integer		"iteration",
		scalar		"weight1",
		scalar		"weight2",
		scalar		"weight3",
		color		"color0",
		color		"color1",
		color		"color2",
		color		"color3",
		color		"color4",
		transform	"transform"
	)
	version 1
	apply texture
end declare

declare shader
	color "soft_vertex_color" ()
	version 1
	apply texture
end declare

declare shader
	color "soft_vertex_color_alpha" ()
	version 1
	apply texture
end declare

declare shader
	color "soft_vertex_color_alpha2" (
		integer		"tspace"
	)
	version 1
	apply texture
end declare


#
# lights. soft_light is completely different now (22 June 99, 2.1.34).
#

declare shader
	color "soft_light" (
		integer		"mode",
		color		"color",
		scalar		"intensity",
		boolean		"shadow",
		scalar		"factor",
		boolean		"atten",
		scalar		"start",
		scalar		"stop",
		scalar		"spread",
		boolean		"use_color",
		scalar		"energy_factor"
	)
	version 2
	apply light
end declare

declare shader
	color "soft_infinite" (
		color		"color",
		vector		"null",
		boolean		"shadow",
		scalar		"factor"
	)
	version 1
	apply light
end declare

declare shader
	color "soft_point" (
		color		"color",
		vector		"null",
		boolean		"shadow",
		scalar		"factor",
		boolean		"atten",
		scalar		"start",
		scalar		"stop"
	)
	version 1
	apply light
end declare

declare shader
	color "soft_spot" (
		color		"color",
		vector		"direction",
		boolean		"shadow",
		scalar		"factor",
		boolean		"atten",
		scalar		"start",
		scalar		"stop",
		scalar		"cone",
		scalar		"spread"
	)
	version 1
	apply light
end declare


#
# displacement
#

declare shader
	scalar "soft_displace" (
		array struct	"texture" {
			color texture	"map",
			integer		"space",
			integer		"comp",	# 0=without, 1=alpha, 2=intens
			scalar		"displace"
		}
	)
	version 1
	apply displace
end declare

declare shader
	color "soft_staticblur" (
		scalar		"width"
	)
	version 1
	apply texture
end declare


#
# shadow
#

declare shader
	color "soft_shadow" (
		color		"diffuse",
		scalar		"transp",
		array struct	"texture" {
			color texture	"map",
			integer		"space",
			integer		"mask",	# 0=without, 1=alpha, 2=intens
			integer		"comp",	# 1=alpha, 2=intens
			scalar		"blend",
			scalar		"diffuse",
			scalar		"transp"
		}
	)
	version 1
	apply shadow
end declare


#
# spherical environment
#

declare shader
	color "soft_env_sphere" (
		scalar		"rotate",
		array struct	"texture" {
			color texture	"map",
			integer		"mask",	# 0=without, 1=alpha, 2=intens
			scalar		"blend"
		}
	)
	version 1
	apply environment
end declare


#
# fog volume shader
#

declare shader
	color "soft_fog" (
		scalar		"start",
		scalar		"stop",
		scalar		"rate",
		color		"transmit",
		boolean		"lightrays"
	)
	version 1
	apply volume
end declare

declare shader
	color "soft_layered_fog" (
		scalar		"start",
		scalar		"stop",
		scalar		"base",
		scalar		"thickness",
		scalar		"density",
		color		"fogcolor",
		boolean		"lightrays"
	)
	version 1
	apply volume
end declare


#
# depth-of-field lens effect
#

declare shader
	color "soft_dof" (
		scalar		"plane",
		scalar		"radius"
	)
	version 1
	apply lens
	scanline off
	trace on
end declare

declare shader
	color "lens_depth_of_field" (
		scalar		"plane",
		scalar		"radius"
	)
	version 1
	apply lens
	scanline off
	trace on
end declare


#
# output filter
#

declare shader
	"out_depth_of_field" (
		scalar		"near",
		scalar		"far",
		scalar		"radius",
		integer		"max",
		scalar		"infinity"
	)
	version 1
	apply output
end declare
