IssueRaiser

Add proper and complete support for multi-pass shaders

<!-- Please fill in *all* the questions below and don't remove any of them. Proposals not following the template below will be closed immediately. --> **Describe the project you are working on:** Top-down 2D rpg with heavy use of visual effects, post-processing and custom depth tests. **Describe the problem or limitation you are having in your project:** I'll often have to create shaders that read from a certain buffer or texture and then write to it or viceversa. This is not possible in a single pass shader as it is technically not supported by graphics cards. So a multi-pass shader is needed. Multi-pass **materials** rendering is also currently not supported for canvas_item shaders which is another related limitation. This is however a proposal for multi-pass **shaders**, here's an example of how they are defined in Unity (just for reference): ```glsl Shader "ShaderName" { Properties { // define shader properties _TextureName("Inspector Description", Type) = "white" {} _FloatSlider("Float Slider Description", Range(0, 1)) = 0.5 } SubShader { // Tags, Identifiers, etc... // first pass Pass { // Tags, Identifiers, etc... // define blend mode, ztest mode, zwrite mode etc. // define used properties/uniforms // define input and/or output structs (appdata, s2f, FragmentOutput...) v2f vert (appdata v) {

Posted by samdze on Feb 20, 2020, 3:05 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

reliability (Other)

Add proper and complete support for multi-pass shaders

samdzeFeb 20, 2020, 3:05 PM

<!-- Please fill in *all* the questions below and don't remove any of them. Proposals not following the template below will be closed immediately. --> **Describe the project you are working on:** Top-down 2D rpg with heavy use of visual effects, post-processing and custom depth tests. **Describe the problem or limitation you are having in your project:** I'll often have to create shaders that read from a certain buffer or texture and then write to it or viceversa. This is not possible in a single pass shader as it is technically not supported by graphics cards. So a multi-pass shader is needed. Multi-pass **materials** rendering is also currently not supported for canvas_item shaders which is another related limitation. This is however a proposal for multi-pass **shaders**, here's an example of how they are defined in Unity (just for reference): ```glsl Shader "ShaderName" { Properties { // define shader properties _TextureName("Inspector Description", Type) = "white" {} _FloatSlider("Float Slider Description", Range(0, 1)) = 0.5 } SubShader { // Tags, Identifiers, etc... // first pass Pass { // Tags, Identifiers, etc... // define blend mode, ztest mode, zwrite mode etc. // define used properties/uniforms // define input and/or output structs (appdata, s2f, FragmentOutput...) v2f vert (appdata v) {

Comments (0)

No comments yet. Start the discussion.

Comment on this issue