# SDL shader interface declaration

min version "2.0.20"
max version "2.1.99"

declare	shader
    color "sdl_color_texture" (

	integer		"type",		# 1=color,2=first procedural..

	# generic texture parameter
	scalar		"amult",
	scalar		"aoffset",
	scalar		"aout",
	boolean		"mirror",

	color		"rgbmult",
	color texture   "rgbmult_tex",

	color		"rgboffset",
	color texture	"rgboffset_tex",

	color		"rgbout",
	color texture	"rgbout_tex",

	scalar		"rotate",

	scalar		"ucoverage",
	scalar		"uoffset",
	scalar		"urepeat",
	scalar		"uscale",
	scalar		"utranslate",
	boolean		"uwrap",

	scalar		"vcoverage",
	scalar		"voffset",
	scalar		"vrepeat",
	scalar		"vscale",
	scalar		"vtranslate",
	boolean		"vwrap",

	# color texture
	color  texture  "texture",

	# grid texture
	scalar		"contrast",
	color		"filler_color",
	color texture	"filler_color_tex",
	color		"line_color",
	color texture	"line_color_tex",
	scalar		"uwidth",
	scalar		"vwidth",

	# granite texture
	color		"color1",
	color texture	"color1_tex",
	color		"color2",
	color texture	"color2_tex",
	color		"color3",
	color texture	"color3_tex",

	# precomputed values
	scalar		"sin_r",
	scalar		"cos_r",

	array struct "supertexture" {
		integer		object_label,
		color texture	"texture"
	}
    )
    version 2
end declare

# identical to the color texture, except the texture parameter

declare	shader
    color "sdl_scalar_texture" (

	integer		"type",		# 1=scalar texture

	# generic texture parameter
	scalar		"amult",
	scalar		"aoffset",
	scalar		"aout",
	boolean		"mirror",

	color		"rgbmult",
	color texture   "rgbmult_tex",

	color		"rgboffset",
	color texture	"rgboffset_tex",

	color		"rgbout",
	color texture	"rgbout_tex",

	scalar		"rotate",

	scalar		"ucoverage",
	scalar		"uoffset",
	scalar		"urepeat",
	scalar		"uscale",
	scalar		"utranslate",
	boolean		"uwrap",

	scalar		"vcoverage",
	scalar		"voffset",
	scalar		"vrepeat",
	scalar		"vscale",
	scalar		"vtranslate",
	boolean		"vwrap",

	# color texture
	scalar texture  "texture",

	# grid texture
	scalar		"contrast",
	color		"filler_color",
	color texture	"filler_color_tex",
	color		"line_color",
	color texture	"line_color_tex",
	scalar		"uwidth",
	scalar		"vwidth",

	# granite texture
	color		"color1",
	color texture	"color1_tex",
	color		"color2",
	color texture	"color2_tex",
	color		"color3",
	color texture	"color3_tex",

	# precomputed values
	scalar		"sin_r",
	scalar		"cos_r"
    )
    version 1
end declare


# identical to the color texture, except the texture parameter

declare	shader
    color "sdl_vector_texture" (

	integer		"type",		# 1=vector texture

	# generic texture parameter
	scalar		"amult",
	scalar		"aoffset",
	scalar		"aout",
	boolean		"mirror",

	color		"rgbmult",
	color texture   "rgbmult_tex",

	color		"rgboffset",
	color texture	"rgboffset_tex",

	color		"rgbout",
	color texture	"rgbout_tex",

	scalar		"rotate",

	scalar		"ucoverage",
	scalar		"uoffset",
	scalar		"urepeat",
	scalar		"uscale",
	scalar		"utranslate",
	boolean		"uwrap",

	scalar		"vcoverage",
	scalar		"voffset",
	scalar		"vrepeat",
	scalar		"vscale",
	scalar		"vtranslate",
	boolean		"vwrap",

	# color texture
	color texture  "texture",

	# grid texture
	scalar		"contrast",
	color		"filler_color",
	color texture	"filler_color_tex",
	color		"line_color",
	color texture	"line_color_tex",
	scalar		"uwidth",
	scalar		"vwidth",

	# granite texture
	color		"color1",
	color texture	"color1_tex",
	color		"color2",
	color texture	"color2_tex",
	color		"color3",
	color texture	"color3_tex",

	# precomputed values
	scalar		"sin_r",
	scalar		"cos_r"
    )
    version 1
end declare

declare shader
    color "sdl_material" (
						# model:
	boolean		"blinn",
	boolean		"lambert",
	boolean		"lightsource",
	boolean		"phong",
	vector texture	"bump",
	color		"color",
	color texture	"color_tex",
	scalar		"diffuse",
						# displacement
	scalar		"eccentricity",
	color		"incandescence",
	color texture	"incandescence_tex",
						# model
						# reflection
	integer		"reflection_limit",
	scalar		"reflectivity",
	scalar texture	"reflectivity_tex",
						# reflect_background
	integer		"refraction_limit",
	scalar		"refractive_index",
	boolean		"respect_reflection_map",
	integer		"shadow_level_limit",
	scalar		"shinyness",
	color		"specular",
	color texture	"specular_tex",
	scalar		"specular_rolloff",
	color		"transparency",
	color texture	"transparency_tex",
						# transparency_shade
	array light	"lights"
    )
    version 1
end declare

declare shader
    color "sdl_shadow" (
	color		"transparency",
	color texture	"transparency_tex",
	scalar		"transparency_shade"
    )
    version 1
end declare

declare shader
    color "sdl_light" (
						# model:
	boolean		"ambient",
	boolean		"point",
	boolean		"linear",
	boolean		"spot",
	boolean		"directional",

	scalar		"ambient_shade",
						# bias
	color		"color",
	scalar		"decay",
						# direction
	scalar		"dropoff",
						# exclusive
						# fog...
						# glow...
						# halo...
	scalar		"intensity",
						# model
						# noise...
	scalar		"penumbra",
						# radial_noise_frequency
	boolean		"shadow",
						# shadow_dither
						# shadowmult
						# shadowoffset
						# shadow_blend_offset
						# shadow_edge_quality
						# shadow_min_depth
						# shadow_output
						# shadow_resolution
						# shadow_samples
	vector		"shine_along",
						# size
						# soft_shadows
	scalar		"spread",

	vector		"linear_axis"		# axis for linear lights
						# star_points
    )
    version 1
end declare

declare shader
    color "sdl_env_cube" (

	vector		"box_size",       
	transform	"transformation",

	color		"rgbmult",
	color texture	"rgbmult_tex",

	color		"rgboffset",
	color texture	"rgboffset_tex",

	color		"rgbout",
	color texture	"rgbout_tex",

	color texture	"top",
	color texture	"bottom",
	color texture	"right",
	color texture	"left",
	color texture	"front",
	color texture	"back"
    )
    version 1
end declare

declare shader
    color "sdl_env_sphere" (
	
	transform	"transformation",

	color		"rgbmult",
	color texture	"rgbmult_tex",

	color		"rgboffset",
	color texture	"rgboffset_tex",

	color		"rgbout",
	color texture	"rgbout_tex",

	boolean		"flip",
	scalar		"shear_u",
	scalar		"shear_v",

	color texture	"image"
    )
    version 1
end declare

declare shader
    color "sdl_matte_plane" (
	boolean		"use_depth",
	scalar		"matte_depth",
	scalar		"matte_order",
	color texture	"matte_plane"
    )
    version 1
end declare
