소스 검색

Delete jme3-core/src/main/resources/Common/MatDefs/Light/modular directory

Ryan McDonough 7 달 전
부모
커밋
7dda826338

+ 0 - 73
jme3-core/src/main/resources/Common/MatDefs/Light/modular/PBRLighting.frag

@@ -1,73 +0,0 @@
-#import "Common/ShaderLib/GLSLCompat.glsllib"
-
-// enable apis and import PBRLightingUtils
-#define ENABLE_PBRLightingUtils_getWorldPosition 1
-#define ENABLE_PBRLightingUtils_getWorldNormal 1
-#define ENABLE_PBRLightingUtils_getWorldTangent 1
-#define ENABLE_PBRLightingUtils_getTexCoord 1
-#define ENABLE_PBRLightingUtils_readPBRSurface 1
-#define ENABLE_PBRLightingUtils_computeDirectLightContribution 1
-#define ENABLE_PBRLightingUtils_computeProbesContribution 1
-
-#import "Common/ShaderLib/module/pbrlighting/PBRLightingUtils.glsllib"
-
-#ifdef DEBUG_VALUES_MODE
-    uniform int m_DebugValuesMode;
-#endif
-
-uniform vec4 g_LightData[NB_LIGHTS];
-uniform vec3 g_CameraPosition;
-
-void main(){
-    vec3 wpos = PBRLightingUtils_getWorldPosition();
-    vec3 worldViewDir = normalize(g_CameraPosition - wpos);
-    
-    // Load surface data
-    PBRSurface surface=PBRLightingUtils_readPBRSurface(worldViewDir);
-    
-    // Calculate direct lights
-    for(int i = 0;i < NB_LIGHTS; i+=3){
-        vec4 lightData0 = g_LightData[i];
-        vec4 lightData1 = g_LightData[i+1];
-        vec4 lightData2 = g_LightData[i+2];    
-        PBRLightingUtils_computeDirectLightContribution(
-          lightData0, lightData1, lightData2, 
-          surface
-        );
-    }
-
-
-    // Calculate env probes
-    PBRLightingUtils_computeProbesContribution(surface);
-
-    // Put it all together
-    gl_FragColor.rgb = vec3(0.0);
-    gl_FragColor.rgb += surface.bakedLightContribution;
-    gl_FragColor.rgb += surface.directLightContribution;
-    gl_FragColor.rgb += surface.envLightContribution;
-    gl_FragColor.rgb += surface.emission;
-    gl_FragColor.a = surface.alpha;
-
-  
-    // outputs the final value of the selected layer as a color for debug purposes. 
-    #ifdef DEBUG_VALUES_MODE
-        if(m_DebugValuesMode == 0){
-            gl_FragColor.rgb = vec3(surface.albedo);
-        }
-        else if(m_DebugValuesMode == 1){
-            gl_FragColor.rgb = vec3(surface.normal);
-        }
-        else if(m_DebugValuesMode == 2){
-            gl_FragColor.rgb = vec3(surface.roughness);
-        }
-        else if(m_DebugValuesMode == 3){
-            gl_FragColor.rgb = vec3(surface.metallic);
-        }
-        else if(m_DebugValuesMode == 4){
-            gl_FragColor.rgb = surface.ao.rgb;
-        }
-        else if(m_DebugValuesMode == 5){
-            gl_FragColor.rgb = vec3(surface.emission.rgb);          
-        }        
-    #endif   
-}

+ 0 - 321
jme3-core/src/main/resources/Common/MatDefs/Light/modular/PBRLighting.j3md

@@ -1,321 +0,0 @@
-MaterialDef PBR Lighting {
-
-    MaterialParameters {
-        Int BoundDrawBuffer
-
-        // Alpha threshold for fragment discarding
-        Float AlphaDiscardThreshold (AlphaTestFallOff)
-
-        //metallicity of the material
-        Float Metallic : 1.0
-        //Roughness of the material
-        Float Roughness : 1.0        
-        // Base material color
-        Color BaseColor : 1.0 1.0 1.0 1.0
-        // The emissive color of the object
-        Color Emissive        
-        // the emissive power
-        Float EmissivePower : 3.0        
-        // the emissive intensity
-        Float EmissiveIntensity : 2.0
-
-        // BaseColor map
-        Texture2D BaseColorMap
-
-        // Metallic map
-        Texture2D MetallicMap -LINEAR
-        
-        // Roughness Map
-        Texture2D RoughnessMap -LINEAR
-
-        //Metallic and Roughness are packed respectively in the b and g channel of a single map
-        // r: AO (if AoPackedInMRMap is true)
-        // g: Roughness
-        // b: Metallic
-        Texture2D MetallicRoughnessMap -LINEAR
-        
-        // Texture of the emissive parts of the material
-        Texture2D EmissiveMap
-
-        // Normal map
-        Texture2D NormalMap -LINEAR
-        // The scalar parameter applied to each normal vector of the normal map
-        Float NormalScale
-
-        //The type of normal map: -1.0 (DirectX), 1.0 (OpenGl)
-        Float NormalType : -1.0
-
-        // For Spec gloss pipeline
-        Boolean UseSpecGloss
-        Texture2D SpecularMap
-        Texture2D GlossinessMap
-        Texture2D SpecularGlossinessMap
-        Color Specular : 1.0 1.0 1.0 1.0
-        Float Glossiness : 1.0
-
-        // Parallax/height map
-        Texture2D ParallaxMap -LINEAR
-
-        // Specular-AA
-        Boolean UseSpecularAA : true
-        // screen space variance,Use the slider to set the strength of the geometric specular anti-aliasing effect between 0 and 1. Higher values produce a blurrier result with less aliasing.
-        Float SpecularAASigma
-        // clamping threshold,Use the slider to set a maximum value for the offset that HDRP subtracts from the smoothness value to reduce artifacts.
-        Float SpecularAAKappa
-
-        //Set to true if parallax map is stored in the alpha channel of the normal map
-        Boolean PackedNormalParallax   
-
-        //Sets the relief height for parallax mapping
-        Float ParallaxHeight : 0.05       
-
-        //Set to true to activate Steep Parallax mapping
-        Boolean SteepParallax
-
-        //Horizon fade
-        Boolean HorizonFade
-
-        // Set to Use Lightmap
-        Texture2D LightMap
-
-        // A scalar multiplier controlling the amount of occlusion applied.
-        // A value of `0.0` means no occlusion. A value of `1.0` means full occlusion.
-        Float AoStrength
-
-        // Set to use TexCoord2 for the lightmap sampling
-        Boolean SeparateTexCoord
-        // the light map is a grayscale ao map, only the r channel will be read.
-        Boolean LightMapAsAOMap
-        Boolean AoPackedInMRMap
-        //shadows
-        Int FilterMode
-        Boolean HardwareShadows
-
-        Texture2D ShadowMap0
-        Texture2D ShadowMap1
-        Texture2D ShadowMap2
-        Texture2D ShadowMap3
-        //pointLights
-        Texture2D ShadowMap4
-        Texture2D ShadowMap5
-        
-        Float ShadowIntensity
-        Vector4 Splits
-        Vector2 FadeInfo
-
-        Matrix4 LightViewProjectionMatrix0
-        Matrix4 LightViewProjectionMatrix1
-        Matrix4 LightViewProjectionMatrix2
-        Matrix4 LightViewProjectionMatrix3
-        //pointLight
-        Matrix4 LightViewProjectionMatrix4
-        Matrix4 LightViewProjectionMatrix5   
-        Vector3 LightPos
-        Vector3 LightDir
-
-        Float PCFEdge
-        Float ShadowMapSize
-
-        // For hardware skinning
-        Int NumberOfBones
-        Matrix4Array BoneMatrices
-
-        // For Morph animation
-        FloatArray MorphWeights
-        Int NumberOfMorphTargets
-        Int NumberOfTargetsBuffers
-                
-        // For instancing
-        Boolean UseInstancing
-
-        // For Vertex Color
-        Boolean UseVertexColor
-
-        Boolean BackfaceShadows : false
-
-        Boolean UseVertexColorsAsSunIntensity
-        Float StaticSunIntensity
-        Boolean BrightenIndoorShadows
-    
-        Int DebugValuesMode
-            // debugs the final value of the selected layer as a color output:         
-            // Layers:
-            //   0 - albedo (unshaded)
-            //   1 - normals
-            //   2 - roughness
-            //   3 - metallic
-            //   4 - ao
-            //   5 - emissive
-    }
-
-    Technique {
-        LightMode SinglePassAndImageBased
-        
-        VertexShader GLSL300 GLSL150 GLSL110:   Common/MatDefs/Light/modular/PBRLighting.vert
-        FragmentShader GLSL300 GLSL150 GLSL110: Common/MatDefs/Light/modular/PBRLighting.frag
-
-        WorldParameters {
-            WorldViewProjectionMatrix
-            CameraPosition
-            WorldMatrix
-            WorldNormalMatrix
-            ViewProjectionMatrix
-            ViewMatrix
-        }
-
-        Defines {  
-            BOUND_DRAW_BUFFER: BoundDrawBuffer       
-            BASECOLORMAP : BaseColorMap            
-            NORMALMAP : NormalMap
-            NORMALSCALE : NormalScale
-            METALLICMAP : MetallicMap
-            ROUGHNESSMAP : RoughnessMap
-            EMISSIVEMAP : EmissiveMap
-            EMISSIVE : Emissive
-            SPECGLOSSPIPELINE : UseSpecGloss
-            PARALLAXMAP : ParallaxMap
-            NORMALMAP_PARALLAX : PackedNormalParallax
-            STEEP_PARALLAX : SteepParallax
-            LIGHTMAP : LightMap
-            SEPARATE_TEXCOORD : SeparateTexCoord
-            DISCARD_ALPHA : AlphaDiscardThreshold                        
-            NUM_BONES : NumberOfBones                        
-            INSTANCING : UseInstancing
-            USE_PACKED_MR: MetallicRoughnessMap
-            USE_PACKED_SG: SpecularGlossinessMap
-            SPECULARMAP : SpecularMap
-            SPECULAR_AA : UseSpecularAA
-            SPECULAR_AA_SCREEN_SPACE_VARIANCE : SpecularAASigma
-            SPECULAR_AA_THRESHOLD : SpecularAAKappa
-            GLOSSINESSMAP : GlossinessMap
-            NORMAL_TYPE: NormalType
-            VERTEX_COLOR : UseVertexColor
-            AO_MAP: LightMapAsAOMap
-            AO_PACKED_IN_MR_MAP : AoPackedInMRMap
-            AO_STRENGTH : AoStrength
-            NUM_MORPH_TARGETS: NumberOfMorphTargets
-            NUM_TARGETS_BUFFERS: NumberOfTargetsBuffers
-            HORIZON_FADE: HorizonFade
-            USE_VERTEX_COLORS_AS_SUN_INTENSITY : UseVertexColorsAsSunIntensity
-            STATIC_SUN_INTENSITY : StaticSunIntensity
-            BRIGHTEN_INDOOR_SHADOWS : BrightenIndoorShadows
-            DEBUG_VALUES_MODE : DebugValuesMode
-        }
-    }
-
-
-    Technique PreShadow {
-
-        VertexShader   GLSL300 GLSL150 GLSL100:   Common/MatDefs/Shadow/PreShadow.vert
-        FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Shadow/PreShadowPBR.frag
-
-        WorldParameters {
-            WorldViewProjectionMatrix
-            WorldViewMatrix
-            ViewProjectionMatrix
-            ViewMatrix
-        }
-
-        Defines {
-            BOUND_DRAW_BUFFER: BoundDrawBuffer
-            DISCARD_ALPHA : AlphaDiscardThreshold
-            NUM_BONES : NumberOfBones
-            INSTANCING : UseInstancing
-            NUM_MORPH_TARGETS: NumberOfMorphTargets
-            NUM_TARGETS_BUFFERS: NumberOfTargetsBuffers
-        }
-
-        ForcedRenderState {
-            FaceCull Off
-            DepthTest On
-            DepthWrite On
-            PolyOffset 5 3
-            ColorWrite Off
-        }
-
-    }
-
-
-    Technique PostShadow {
-        VertexShader   GLSL310 GLSL300 GLSL150 GLSL100:   Common/MatDefs/Shadow/PostShadow.vert
-        FragmentShader GLSL310 GLSL300 GLSL150 GLSL100: Common/MatDefs/Shadow/PostShadowPBR.frag
-
-        WorldParameters {
-            WorldViewProjectionMatrix
-            WorldMatrix
-            ViewProjectionMatrix
-            ViewMatrix
-        }
-
-        Defines {
-            BOUND_DRAW_BUFFER: BoundDrawBuffer
-            HARDWARE_SHADOWS : HardwareShadows
-            FILTER_MODE : FilterMode
-            PCFEDGE : PCFEdge
-            DISCARD_ALPHA : AlphaDiscardThreshold           
-            SHADOWMAP_SIZE : ShadowMapSize
-            FADE : FadeInfo
-            PSSM : Splits
-            POINTLIGHT : LightViewProjectionMatrix5
-            NUM_BONES : NumberOfBones
-            INSTANCING : UseInstancing
-            BACKFACE_SHADOWS: BackfaceShadows
-            NUM_MORPH_TARGETS: NumberOfMorphTargets
-            NUM_TARGETS_BUFFERS: NumberOfTargetsBuffers
-        }
-
-        ForcedRenderState {
-            Blend Modulate
-            DepthWrite Off                 
-            PolyOffset -0.1 0
-        }
-    }
-
-    Technique PreNormalPass {
-
-        VertexShader   GLSL300 GLSL150 GLSL100 :   Common/MatDefs/SSAO/normal.vert
-        FragmentShader GLSL300 GLSL150 GLSL100 : Common/MatDefs/SSAO/normal.frag
-
-        WorldParameters {
-            WorldViewProjectionMatrix
-            WorldViewMatrix
-            NormalMatrix
-            ViewProjectionMatrix
-            ViewMatrix
-        }
-
-        Defines {
-            BOUND_DRAW_BUFFER: BoundDrawBuffer
-            BASECOLORMAP_ALPHA : BaseColorMap            
-            NUM_BONES : NumberOfBones
-            INSTANCING : UseInstancing
-            NUM_MORPH_TARGETS: NumberOfMorphTargets
-            NUM_TARGETS_BUFFERS: NumberOfTargetsBuffers
-        }
-
-    }
-
-    Technique Glow {
-
-        VertexShader   GLSL300 GLSL150 GLSL100:   Common/MatDefs/Misc/Unshaded.vert
-        FragmentShader GLSL300 GLSL150 GLSL100: Common/MatDefs/Light/PBRGlow.frag
-
-        WorldParameters {
-            WorldViewProjectionMatrix
-            ViewProjectionMatrix
-            ViewMatrix
-        }
-
-        Defines {
-            HAS_EMISSIVEMAP : EmissiveMap
-            HAS_EMISSIVECOLOR : Emissive
-            BOUND_DRAW_BUFFER: BoundDrawBuffer
-            NEED_TEXCOORD1
-            NUM_BONES : NumberOfBones
-            INSTANCING : UseInstancing
-            NUM_MORPH_TARGETS: NumberOfMorphTargets
-            NUM_TARGETS_BUFFERS: NumberOfTargetsBuffers
-        }
-    }
-
-}

+ 0 - 75
jme3-core/src/main/resources/Common/MatDefs/Light/modular/PBRLighting.vert

@@ -1,75 +0,0 @@
-#import "Common/ShaderLib/GLSLCompat.glsllib"
-#import "Common/ShaderLib/Instancing.glsllib"
-#import "Common/ShaderLib/Skinning.glsllib"
-#import "Common/ShaderLib/MorphAnim.glsllib"
-
-uniform vec4 m_BaseColor;
-uniform vec4 g_AmbientLightColor;
-varying vec2 texCoord;
-
-#ifdef SEPARATE_TEXCOORD
-  varying vec2 texCoord2;
-  attribute vec2 inTexCoord2;
-#endif
-
-varying vec4 Color;
-
-attribute vec3 inPosition;
-attribute vec2 inTexCoord;
-attribute vec3 inNormal;
-
-#if defined (VERTEX_COLOR) || defined(USE_VERTEX_COLORS_AS_SUN_INTENSITY)
-    attribute vec4 inColor;
-#endif
-
-#if defined(USE_VERTEX_COLORS_AS_SUN_INTENSITY)
-    varying vec4 vertColors;
-#endif
-
-varying vec3 wNormal;
-varying vec3 wPosition;
-
-attribute vec4 inTangent;
-varying vec4 wTangent;
-
-void main(){
-    vec4 modelSpacePos = vec4(inPosition, 1.0);
-    vec3 modelSpaceNorm = inNormal;
-    vec3 modelSpaceTan  = inTangent.xyz;
-
-    #ifdef USE_VERTEX_COLORS_AS_SUN_INTENSITY
-        vertColors = inColor;
-    #endif
-
-    #ifdef NUM_MORPH_TARGETS
-         #if defined(NORMALMAP) && !defined(VERTEX_LIGHTING)
-            Morph_Compute(modelSpacePos, modelSpaceNorm, modelSpaceTan);
-         #else
-            Morph_Compute(modelSpacePos, modelSpaceNorm);
-         #endif
-    #endif
-
-    #ifdef NUM_BONES
-         #if defined(NORMALMAP) && !defined(VERTEX_LIGHTING)
-            Skinning_Compute(modelSpacePos, modelSpaceNorm, modelSpaceTan);
-         #else
-            Skinning_Compute(modelSpacePos, modelSpaceNorm);
-         #endif
-    #endif
-
-    gl_Position = TransformWorldViewProjection(modelSpacePos);
-    texCoord = inTexCoord;
-    #ifdef SEPARATE_TEXCOORD
-       texCoord2 = inTexCoord2;
-    #endif
-
-    wPosition = TransformWorld(modelSpacePos).xyz;
-    wNormal  = TransformWorldNormal(modelSpaceNorm);
-    wTangent = vec4(TransformWorldNormal(modelSpaceTan),inTangent.w);
-
-    Color = m_BaseColor;
-    
-    #ifdef VERTEX_COLOR                    
-        Color *= inColor;
-    #endif
-}