material = "core/stingray_renderer/environments/env_materials"

variables = {
	sun_enabled = { type="scalar" value=1.0 min=0.0 max=1.0 step=1.0 }
	sun_direction = { type="vector3" ui_type="hemisphere_direction" value=[0.0 0.0 -1.0] }
	sun_color = { type="vector3" ui_type="hdr_color" value=[1.0 1.0 1.0]  min=[0 0 0] max=[5 5 5] step=[0.003 0.003 0.003] }
	sun_shadows_enabled = { type="scalar" value=1.0 min=0.0 max=1.0 step=1.0 }
	
	sun_shadow_slice_depth_ranges = { type="vector2_array" ui_name="Cascaded Shadow Mapping" value=[0 8 8 19 19 56 56 80] ui_type="cascaded_shadow_mapping" num_slices=4 start=0 end=80 log_linear_blend=0.4 }

	skydome_map = { type="resource" ui_name="Skydome Texture" value="" }
	skydome_intensity = { type="scalar" ui_name="Skydome Intensity" value=1 min=0.001 max=2 step=0.01  }
	global_diffuse_map = { type="resource" ui_name="Global Diffuse Map" value="" }
	global_specular_map = { type="resource" ui_name="Global Specular Map" value="" }
	ambient_tint = { type="vector3" ui_name="Ambient Tint" ui_type="hdr_color" value=[1.0 1.0 1.0] min=[0 0 0] max=[5 5 5] step=[0.003 0.003 0.003] }

	emissive_particle_intensity = { type="scalar" ui_name="Emissive Particle Intensity" value=1 min=0.001 max=16 step=0.01 }

	offscreen_target_projection = { type="scalar" ui_name="Enable offscreen gui projection" value=0.0 min=0.0 max=1.0 step=1.0 }

	fog_enabled = { type="scalar" ui_name="Enable Fog" value=1.0 min=0.0 max=1.0 step=1.0 }
	fog_depth_range = { type="vector2" ui_name="Fog Depth Range" value=[10 100] min=[0 0] max=[5000 5000] step=[0.01 0.01 0.01] } 
	fog_color = { type="vector3" ui_name="Fog Color" ui_type="hdr_color" value=[0.6 0.6 0.6] min=[0 0 0] max=[1 1 1] step=[0.001 0.001 0.001] }	
	fog_sun_blend = { type="vector3" ui_name="Fog Sun Blend / Exponent / Strength" value=[1.0 8.0 1.0] min=[0 1 0] max = [1 16 1] step = [0.001 0.01 0.001] }

	exposure = { type="scalar" ui_name="Exposure/Grey Value" value=1 min=0.001 max=10 step=0.01 }

	// Used to globally expose world to shadow map transforms for sun shadow mapping
	sun_world_to_shadow_slice0 = { type="matrix4x4" value=[1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1] }
	sun_world_to_shadow_slice1 = { type="matrix4x4" value=[1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1] }
	sun_world_to_shadow_slice2 = { type="matrix4x4" value=[1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1] }
	sun_world_to_shadow_slice3 = { type="matrix4x4" value=[1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1] }
	
		
	bloom_enabled = { type="scalar" ui_name="Enable Bloom" value=1.0 min=0.0 max=1.0 step=1.0 }
	bloom_threshold_offset_falloff = { type="vector3" ui_name="Bloom Threshold / Offset / Falloff" value=[0.8 1.0 1.0] min=[0.0 0.01 0.0] max=[5.0 2 1.0] step=[0.001 0.001 0.001] }
	global_lens_dirt_map = { type="resource" ui_name="Global Lens Dirt Map" value="core/stingray_renderer/environments/lensdirt" }
	bloom_lens_dirt_amount = { type="scalar" ui_name="Lens Dirt Amount" value=1.0 min=0.0 max=10.0 step=0.001 }
	bloom_tint = { type="vector3" ui_name="Bloom Tint" ui_type="hdr_color" value=[1.0 1.0 1.0] min=[0 0 0] max=[5 5 5] step=[0.003 0.003 0.003] }

	motion_blur_enabled = { type="scalar" ui_name="Enable Motion Blur" value=0.0 min=0.0 max=1.0 step=1.0 }
	motion_blur_amount = { type="scalar" ui_name="Motion Blur Amount" value=2.0 min=0.0 max=5.0 step=0.001 }	

	ao_enabled = { type="scalar" ui_name="Enable AO" value=1.0 min=0.0 max=1.0 step=1.0 }
	ao_quality = { type="scalar" ui_name="AO Quality" value=2.0 min=1.0 max=3.0 step=1.0 }
	ao_radius = { type="scalar" ui_name="AO Radius" value=0.2 min=0.1 max=1.0 step=0.001 }
	ao_intensity = { type="scalar" ui_name="AO Intensity" value=0.6 min=0.0 max=1.0 step=0.01 }

	dof_enabled = { type="scalar" ui_name="Enable Depth Of Field" value=1.0 min=0.0 max=1.0 step=1.0 }
	dof_focal_distance = { type="scalar" ui_name="Focus Distance" value=10.0 min=0.0 max=5000 step=0.01 }
	dof_focal_region = { type="scalar" ui_name="Focus Region" value=5 min=0.0 max=2500 step=0.01 }
	dof_focal_region_start = { type="scalar" ui_name="Focus Region Start" value=5 min=0.01 max=2500 step=0.01 }
	dof_focal_region_end = { type="scalar" ui_name="Focus Region End" value=5 min=0.01 max=2500 step=0.01 }
	dof_focal_near_scale = { type="scalar" ui_name="Near Scale" value=1.0 min=0.0 max=1.0 step=0.001 }
	dof_focal_far_scale = { type="scalar" ui_name="Far Scale" value=1.0 min=0.0 max=1.0 step=0.001 }

	ssr_enabled = { type="scalar" ui_name="Enable Screen Space Reflections" value=0 min=0 max=1 step=1 }
	ssr_surface_thickness_threshold = { type="vector2"  ui_name="SSR Mask: Surface Thickness Threshold" value=[0.001 5] min=[0.0001 0.1] max=[0.01 20] step=[0.000001 0.001] }
	ssr_screen_edge_threshold = { type="scalar"  ui_name="SSR Mask: Screen Edge Threshold" value=0.05 min=0.01 max=0.2 step=0.00001 }
	ssr_ray_bending_enabled = { type="scalar" ui_name="SSR Bending" value=0 min=0 max=1 step=0.0001 }

	lens_quality_enabled = { type="scalar" ui_name="Enable Lens Quality" value=0.0 min=0.0 max=1.0 step=1.0 }
	lens_quality_properties = {type="vector3" ui_name="Lens Quality (Distortion | Fringe Intensity | Fringe Color)" value=[0.0 0.0 0.0] min=[-0.6 0.0 0.0] max=[0.9 1.0 1.0] step=[0.001 0.001 0.001] }

	vignette_enabled = { type="scalar" ui_name="Enable Vignette" value=1.0 min=0.0 max=1.0 step=1.0 }
	//vignette_properties = { type="vector3" ui_name="Vignette (Radius | Falloff | Opacity)" value=[1.0 0.5 1.0] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.001 0.001 0.001] }

	color_grading_enabled = { type="scalar" ui_name="Enable Color Grading" value=0.0 min=0.0 max=1.0 step=1.0 }
	color_grading_map = { type="resource" ui_name="Color Grading Volume Map" value="core/stingray_renderer/environments/color_grading_identity" }

	// Fatshark

	global_roughness_multiplier = { type="scalar" ui_name="Global Roughness Multiplier" value=1.0 min=0.0 max=2.0 step=0.001 }
	
	secondary_sun_enabled = { type="scalar" ui_name="Enable Secondary Sun" value=0.0 min=0.0 max=1.0 step=1.0 }
	secondary_sun_direction = { type="vector3" ui_name="Secondary Sun Direction" ui_type="hemisphere_direction" value=[0 0 -1] }
	secondary_sun_color = { type="vector3" ui_name="Secondary Sun Color" ui_type="hdr_color" value=[1.0 1.0 1.0] min=[0 0 0] max=[5 5 5] step=[0.003 0.003 0.003] }
	secondary_sun_blend = { type="vector3" ui_name="Secondary Sun Blend / Exponent / Strength" value=[1.0 8.0 1.0] min=[0 1 0] max = [1 16 1] step = [0.001 0.01 0.001] }
	
	custom_fog_blend_enabled = { type="scalar" ui_name="Enable Custom Fog Blend" value=0.0 min=0.0 max=1.0 step=1.0 }
	custom_fog_blend_direction = { type="vector3" ui_name="Custom Fog Blend Direction" ui_type="hemisphere_direction" value=[0 0 -1] }
	custom_fog_blend_color = { type="vector3" ui_name="Custom Fog Blend Color" ui_type="hdr_color" value=[1.0 1.0 1.0] min=[0 0 0] max=[5 5 5] step=[0.003 0.003 0.003] }
	custom_fog_blend = { type="vector3" ui_name="Custom Fog Blend / Exponent / Strength" value=[1.0 8.0 1.0] min=[0 1 0] max = [1 16 1] step = [0.001 0.01 0.001] }

	light_shaft_enabled = { type="scalar" ui_name="Enable Light Shafts" value=1.0 min=0.0 max=1.0 step=1.0 }
	light_shaft_settings = { type="vector2" ui_name="Light Shaft Exposure/Falloff" value=[1 1] min=[0.001 0.001] max=[8 2] step=[0.001 0.001] }
	light_shaft_weigth = { type="scalar" ui_name="Light Shaft Weight" value=0.01 min=0.0 max=1.0 step=0.001 }

	vignette_scale_falloff_opacity = { type="vector3" ui_name="Vignette [scale, falloff, opacity]" value=[3 2.5 0] min=[0 0.1 0] max=[10 10 1] step=[0.001 0.001 0.001] }
	vignette_color = { type="vector3" ui_name="Vignette Color" value=[0 0 0] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.001 0.001 0.001] }
	
	outline_thickness = { type="vector4" ui_name="Outline Thickness" value=[1.0 1.0 1.0 1.0] min=[0.1 0.1 0.1 0.1] max=[4.0 4.0 4.0 4.0] step=[0.01 0.01 0.01 0.01] }

	outline_multiplier_red = { type="scalar" ui_name="Outline Intensity Red" value=1.0 min=0.0 max=1.0 step=0.001 }
	outline_multiplier_green = { type="scalar" ui_name="Outline Intensity Green" value=1.0 min=0.0 max=1.0 step=0.001 }
	outline_multiplier_blue = { type="scalar" ui_name="Outline Intensity Blue" value=1.0 min=0.0 max=1.0 step=0.001 }
	outline_multiplier_alpha = { type="scalar" ui_name="Outline Intensity Alpha" value=1.0 min=0.0 max=1.0 step=0.001 }

	outline_color_red = { type="vector3" ui_name="Outline Color Red Channel" value=[1.0 1.0 0.3] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.001 0.001 0.001] }
	outline_color_green = { type="vector3" ui_name="Outline Color Green Channel" value=[1.0 1.0 0.3] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.001 0.001 0.001] }
	outline_color_blue = { type="vector3" ui_name="Outline Color Blue Channel" value=[1.0 1.0 0.3] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.001 0.001 0.001] }
	outline_color_alpha = { type="vector3" ui_name="Outline Color Red Channel" value=[1.0 1.0 0.3] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.001 0.001 0.001] }

	heatmap_world_position = { type="vector2" ui_name="Heatmap World Position" value=[-500 -500] min=[-1000.0 -1000.0] max=[1000.0 1000.0] step=[1 1] }
	heatmap_world_extents = { type="vector2" ui_name="Heatmap World Extents" value=[1000 1000] min=[-1000.0 -1000.0] max=[1000.0 1000.0] step=[1 1] }

	skydome_fog_height_falloff = { type="vector2" ui_name="Skydome Fog Height/Falloff" value=[0 -50] min=[0 -50] max=[1 0] step=[0.001 0.01] } 
	skydome_tint_color = { type="vector3" ui_name="Skydome Tint Color" ui_type="hdr_color" value=[1.0 1.0 1.0] min=[0 0 0] max=[1 1 1] step=[0.001 0.001 0.001] }	
	skydome_u_offset = { type="scalar" ui_name="Skydome Rotation" value=0 min=0 max=1 step=0.001 }
	skydome_cloud_map = { type="resource" ui_name="Skydome Cloud Map" value="core/stingray_renderer/environments/empty_black" }
	skydome_cloud_speed_scale = { type="vector2" ui_name="Skydome Cloud Speed/Scale" value=[0 1.0] min=[0 0] max=[1 2.0] step=[0.001 0.001] } 

	fog_type = { type="integer" ui_name="Default Exp Height/Exp Height/Exp/Linear Depth" value=0.0 min=0.0 max=3.0 step=1.0 }
	height_fog_offset_falloff = { type="vector2" ui_name="Exp Height Offset/Falloff" value=[0 500.0] min=[-1000 0.1] max=[1000 5000.0] step=[0.001 0.001] }

	ambient_diffuse_fade_type = { type="integer" ui_name="Ambient Fade Type None/Up/Down/Mirror" value=0.0 min=0.0 max=3.0 step=1.0 }
	ambient_diffuse_fade = { type="vector3" ui_name="Ambient Fade Min/Offset/Falloff" value=[0 0 10] min=[0 -100 1] max=[1.0 100 100.0] step=[0.001 0.001 0.001] }

	eye_adaptation_enabled = { type="scalar" ui_name="Eye Adaptation Enabled" value=0.0 min=0.0 max=1.0 step=1.0 }
	eye_adaptation_speed_min_max = { type="vector3" ui_name="Eye Adaptation Speed/Min/Max" value=[1.0 0.01 30] min=[0.1 0.01 0.01] max=[10.0 30 30.0] step=[0.001 0.001 0.001] }

	outline_enabled = { type="integer" ui_name="Outline Enabled" value=1.0 min=0.0 max=1.0 step=1.0  }
	
	
	ssm_enabled = { type="scalar" ui_name="SSM Enabled" value=0.0 min=0.0 max=1.0 step=1.0  }
	ssm_constant_update_enabled = { type="scalar" ui_name="SSM Constant Update (for debug)" value=0.0 min=0.0 max=1.0 step=1.0  }
	ssm_center = { type="vector3" ui_name="SSM Center" value=[0 0 0] min=[-2000 -2000 -2000] max=[2000 2000 2000] step=[0.001 0.001 0.001] }
	ssm_near_far = { type="vector2" ui_name="SSM Near/Far Offset" value=[0 0] min=[-1000 -1000] max=[1000 1000] step=[0.001 0.001] }
	
	ssm_radius = { type="scalar" ui_name="SSM Radius" value=200 min=1 max=1000 step=0.001 }
	ssm_rotation = { type="scalar" ui_name="SSM Rotation" value=0 min=-360 max=360 step=0.001 }

	local_shadow_map_bias = { type="vector3" ui_name="Local Shadow Map Bias Min/Max/Blend Distance" value=[0.0001 0.015 50.0] min=[0.0 0.0 10] max=[0.005 0.1 100.0] step=[0.0001 0.0001 1.0] }
	sun_shadow_map_bias = { type="vector3" ui_name="Sun Shadow Map Bias Min/Max/Blend Distance" value=[0.0001 0.001 50.0] min=[0.0 0.0 10] max=[0.005 0.1 100.0] step=[0.0001 0.0001 1.0] }
	ssm_shadow_map_bias = { type="vector3" ui_name="SSM Shadow Map Bias Min/Max/Blend Distance" value=[0.0005 0.0001 20.0] min=[0.0 0.0 10] max=[0.005 0.1 100.0] step=[0.0001 0.0001 1.0] }

	eye_intensity = { type="scalar" ui_name="Eye Intensity" value=1.0 min=0.0 max=10.0 step=0.01 }
 
	temporal_effects_enabled = { type="scalar" ui_name="Temporal Effects Enabled (taa, ssr, ssao etc)" value=1.0 min=0.0 max=1.0 step=1.0  }

	wind_amount = { type="vector3" ui_name="Wind Amount" value=[0.0 0.0 0.0] min=[0.0 0.0 0.0] max=[1.0 1.0 1.0] step=[0.0001 0.0001 0.0001] }
}

editor = [
	"global_roughness_multiplier"
	
	"skydome_map"
	"skydome_u_offset"
	"skydome_intensity"
	"skydome_tint_color"
	"skydome_cloud_map"
	"skydome_cloud_speed_scale"
	"global_diffuse_map"
	"global_specular_map"
	"ambient_tint"
	"ambient_diffuse_fade_type"
	"ambient_diffuse_fade"

	"sun_enabled"
	"sun_direction"
	"sun_color"
	"sun_shadows_enabled"
	"sun_shadow_slice_depth_ranges"
	"sun_shadow_map_bias"

	"local_shadow_map_bias"
	
	"ssm_enabled"
	"ssm_constant_update_enabled"
	"ssm_center"
	"ssm_near_far"
	"ssm_shadow_map_bias"
	"ssm_radius"
	"ssm_rotation"

	"secondary_sun_enabled"
	"secondary_sun_direction"
	"secondary_sun_color"
	"secondary_sun_blend"

	"light_shaft_enabled"
	"light_shaft_settings"
	"light_shaft_weigth"

	"emissive_particle_intensity"

	"offscreen_target_projection"

	"fog_enabled"
	"fog_type"
	"fog_depth_range"
	"height_fog_offset_falloff"
	"fog_color"
	"fog_sun_blend"
	"custom_fog_blend_enabled"
	"custom_fog_blend_direction"
	"custom_fog_blend_color"
	"custom_fog_blend"
	
	"skydome_fog_height_falloff"

	"exposure"
	"eye_adaptation_enabled"
	"eye_adaptation_speed_min_max"

	"bloom_enabled"
	"bloom_threshold_offset_falloff"
	"global_lens_dirt_map"
	"bloom_lens_dirt_amount"
	"bloom_tint"

	"motion_blur_enabled"
	"motion_blur_amount"

	"ao_enabled"
	"ao_quality"
	"ao_radius"
	"ao_intensity"

	"dof_enabled"
	"dof_focal_distance"
	"dof_focal_region"
	"dof_focal_region_start"
	"dof_focal_region_end"
	"dof_focal_near_scale"
	"dof_focal_far_scale"

	"ssr_enabled"
	"ssr_surface_thickness_threshold"
	"ssr_screen_edge_threshold"
	"ssr_ray_bending_enabled"

	"lens_quality_enabled"
	"lens_quality_properties"

	"vignette_enabled"
	//"vignette_properties"
	"vignette_scale_falloff_opacity"
	"vignette_color"

	//"color_grading_enabled"
	"color_grading_map"

	"outline_enabled"
	"outline_thickness"

	"eye_intensity"

	"temporal_effects_enabled"

	"wind_amount"
]
