All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Common.MatDefs.Misc.Particle.j3md Maven / Gradle / Ivy

The newest version!
MaterialDef Point Sprite {

    MaterialParameters {
        Texture2D Texture
        Float Quadratic
        Boolean PointSprite
        
        //only used for soft particles
        Texture2D DepthTexture
        Float Softness
        Int NumSamplesDepth

        // Texture of the glowing parts of the material
        Texture2D GlowMap
        // The glow color of the object
        Color GlowColor
    }

    Technique {

        VertexShader   GLSL100 : Common/MatDefs/Misc/Particle.vert
        FragmentShader GLSL120 : Common/MatDefs/Misc/Particle.frag

        WorldParameters {
            WorldViewProjectionMatrix
            WorldViewMatrix
            WorldMatrix
            CameraPosition
        }

        RenderState {
            Blend AlphaAdditive
            DepthWrite Off
            PointSprite On
        }

        Defines {
            USE_TEXTURE : Texture
            POINT_SPRITE : PointSprite
        }
    }

    Technique {

        // This technique is used in two cases:
        // - When the driver doesn't support GLSL 1.2
        // - When running on OpenGL ES 2.0
        // Point sprite should be used if running on ES2, but crash
        // if on desktop (because its not supported by HW)

        VertexShader   GLSL100 : Common/MatDefs/Misc/Particle.vert
        FragmentShader GLSL100 : Common/MatDefs/Misc/Particle.frag

        WorldParameters {
            WorldViewProjectionMatrix
            WorldViewMatrix
            WorldMatrix
            CameraPosition
        }

        RenderState {
            Blend AlphaAdditive
            DepthWrite Off
            PointSprite On
        }

        Defines {
            USE_TEXTURE : Texture
            POINT_SPRITE : PointSprite
        }
    }

    Technique PreShadow {

        VertexShader   GLSL100 : Common/MatDefs/Misc/Particle.vert
        FragmentShader GLSL100 : Common/MatDefs/Misc/Particle.frag

        WorldParameters {
            WorldViewProjectionMatrix
            WorldViewMatrix
            WorldMatrix
            CameraPosition
        }

        Defines {
            USE_TEXTURE : Texture
            PRE_SHADOW
        }

        ForcedRenderState {
            DepthWrite On
            ColorWrite Off
        }
    }

    Technique SoftParticles{

        VertexShader   GLSL100 : Common/MatDefs/Misc/SoftParticle.vert
        FragmentShader GLSL100 : Common/MatDefs/Misc/SoftParticle.frag

        WorldParameters {
            WorldViewProjectionMatrix
            WorldViewMatrix
            WorldMatrix
            CameraPosition
        }

        RenderState {
            Blend AlphaAdditive
            DepthWrite Off
        }

        Defines {
            USE_TEXTURE : Texture
        }
    }

    Technique SoftParticles15{

        VertexShader   GLSL100 : Common/MatDefs/Misc/SoftParticle.vert
        FragmentShader GLSL150 : Common/MatDefs/Misc/SoftParticle15.frag

        WorldParameters {
            WorldViewProjectionMatrix
            WorldViewMatrix
            WorldMatrix
            CameraPosition
        }

        RenderState {
            Blend AlphaAdditive
            DepthWrite Off
            PointSprite On            
        }

        Defines {
            USE_TEXTURE : Texture
            POINT_SPRITE : PointSprite
            RESOLVE_DEPTH_MS : NumSamplesDepth
        }
    }

    Technique {
        RenderState {
            Blend AlphaAdditive
            // DepthWrite Off
            // AlphaTestFalloff 0.01
        }
    }

   Technique Glow {

        VertexShader GLSL100:   Common/MatDefs/Misc/Unshaded.vert
        FragmentShader GLSL100: Common/MatDefs/Light/Glow.frag

        WorldParameters {
            WorldViewProjectionMatrix
        }

        Defines {
            NEED_TEXCOORD1
            HAS_GLOWMAP : GlowMap
            HAS_GLOWCOLOR : GlowColor
        }

        RenderState {
            PointSprite On
            Blend AlphaAdditive
            DepthWrite Off
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy