Jump to content

Tutorial shader "Creating a Custom Shader for Deferred Rendering Pass" has no shadows


photo

Recommended Posts

I am trying to create my custom shader by following the tutorial on Unigine documentation "Creating a Custom Shader for Deferred Rendering Pass", but there are no shadows, so how can I add them to such shader?

Link to comment

Hi Alexander,

You can refer to XML mesh_base from <SDK>/data/core/materials/ or ULON mesh.abstmat from <SDK>/data/core/materials/abstract/ (2.15+).
Specifically try adding those passes:

	Pass shadow
	{
		Vertex = mesh_shader
		Control = mesh_shader
		Evaluate = mesh_shader
		Fragment = mesh_shader
	}
	
	Pass depth_pre_pass
	{
		Vertex = mesh_shader
		Control = mesh_shader
		Evaluate = mesh_shader
		Fragment = mesh_shader
	}
	
	Pass ms_depth
	{
		Vertex = mesh_shader
		Control = mesh_shader
		Evaluate = mesh_shader
		Fragment = mesh_shader
	}


For editor selection/visualizer to work, add wireframe passes like so:

	Pass wireframe
	{
		Vertex = mesh_shader
		Control = mesh_shader
		Evaluate = mesh_shader
		Geometry = "core/materials/shaders/default/wireframe/wireframe.geom"
		Fragment = "core/materials/shaders/default/wireframe/wireframe.frag"
	}
	
	Pass visualizer_solid
	{
		Vertex = mesh_shader
		Control = mesh_shader
		Evaluate = mesh_shader
		Fragment = "core/materials/shaders/default/wireframe/wireframe.frag"
	}


And to support lightmaps add this pass

	Pass lightmap_data
	{
		Vertex = "core/materials/shaders/default/mesh/lightmap_data.shader"
		Fragment = "core/materials/shaders/default/mesh/lightmap_data.shader"
	}


For shader code for this examples refer to core/materials/abstract/mesh/mesh.abstmat.
For SDK's before 2.15 please refer to core/materials/default/mesh/mesh_base.basemat.

Best regards.

May RenderDoc/Nsight Graphics/Intel GPA bless you

Link to comment
×
×
  • Create New...