- h2d
- col
- Bounds - h2d.col
- Cell - h2d.col
- Circle - h2d.col
- Collider - h2d.col
- Delaunay - h2d.col
- DelaunayTriangle - h2d.col
- Diagram - h2d.col
- Edge - h2d.col
- Halfedge - h2d.col
- IBounds - h2d.col
- IPoint - h2d.col
- IPolygon - h2d.col
- IPolygons - h2d.col
- Line - h2d.col
- Matrix - h2d.col
- OffsetKind - h2d.col
- PixelsCollider - h2d.col
- Point - h2d.col
- PointImpl - h2d.col
- Polygon - h2d.col
- PolygonCollider - h2d.col
- Polygons - h2d.col
- Polynomial - h2d.col
- Ray - h2d.col
- RoundRect - h2d.col
- Segment - h2d.col
- Segments - h2d.col
- Triangle - h2d.col
- Voronoi - h2d.col
- filter
- AbstractMask - h2d.filter
- Ambient - h2d.filter
- Bloom - h2d.filter
- Blur - h2d.filter
- ColorMatrix - h2d.filter
- Displacement - h2d.filter
- DropShadow - h2d.filter
- Filter - h2d.filter
- Glow - h2d.filter
- Group - h2d.filter
- InnerGlow - h2d.filter
- Mask - h2d.filter
- Nothing - h2d.filter
- Outline - h2d.filter
- Shader - h2d.filter
- ToneMapping - h2d.filter
- impl
- Align - h2d
- Anim - h2d
- BasicElement - h2d
- BatchElement - h2d
- Bitmap - h2d
- BlendMode - h2d
- Camera - h2d
- CdbLevel - h2d
- CheckBox - h2d
- Console - h2d
- ConsoleArg - h2d
- ConsoleArgDesc - h2d
- Drawable - h2d
- Dropdown - h2d
- Flow - h2d
- FlowAlign - h2d
- FlowLayout - h2d
- FlowOverflow - h2d
- FlowProperties - h2d
- Font - h2d
- FontChar - h2d
- FontType - h2d
- Graphics - h2d
- HtmlText - h2d
- ImageVerticalAlign - h2d
- Interactive - h2d
- Kerning - h2d
- KeyFrames - h2d
- KeyframesLayer - h2d
- LayerSpec - h2d
- Layers - h2d
- LevelGroup - h2d
- LevelLayer - h2d
- LevelLayerData - h2d
- LevelObject - h2d
- LevelObjectInstance - h2d
- LevelSpec - h2d
- LevelTileset - h2d
- LineHeightMode - h2d
- LoadingScene - h2d
- Mask - h2d
- Object - h2d
- ObjectFollower - h2d
- PartEmitMode - h2d
- ParticleGroup - h2d
- Particles - h2d
- RenderContext - h2d
- SDFChannel - h2d
- ScaleGrid - h2d
- ScaleMode - h2d
- ScaleModeAlign - h2d
- Scene - h2d
- Slider - h2d
- SpriteBatch - h2d
- Text - h2d
- TextInput - h2d
- Tile - h2d
- TileGroup - h2d
- TileSpec - h2d
- Video - h2d
- ZGroup - h2d
- col
- h3d
- anim
- AnimatedObject - h3d.anim
- Animation - h3d.anim
- BlendSpace2D - h3d.anim
- BlendSpace2DPoint - h3d.anim
- BlendSpaceObject - h3d.anim
- BufferAnimation - h3d.anim
- BufferObject - h3d.anim
- DataLayout - h3d.anim
- DynamicJoint - h3d.anim
- Joint - h3d.anim
- LinearAnimation - h3d.anim
- LinearFrame - h3d.anim
- LinearObject - h3d.anim
- SimpleBlend - h3d.anim
- Skin - h3d.anim
- SmoothTarget - h3d.anim
- SmoothTransition - h3d.anim
- SmoothedObject - h3d.anim
- Transition - h3d.anim
- col
- Bounds - h3d.col
- Capsule - h3d.col
- Collider - h3d.col
- FPoint - h3d.col
- Frustum - h3d.col
- GroupCollider - h3d.col
- HeightMap - h3d.col
- IPoint - h3d.col
- ObjectCollider - h3d.col
- OptimizedCollider - h3d.col
- OrientedBounds - h3d.col
- Plane - h3d.col
- Point - h3d.col
- Polygon - h3d.col
- PolygonBuffer - h3d.col
- Ray - h3d.col
- Seg - h3d.col
- SkinCollider - h3d.col
- SkinColliderDebugObj - h3d.col
- Sphere - h3d.col
- TransformCollider - h3d.col
- TriPlane - h3d.col
- impl
- AllocStats - h3d.impl
- Benchmark - h3d.impl
- Driver - h3d.impl
- Feature - h3d.impl
- GPUBuffer - h3d.impl
- GlDriver - h3d.impl
- InstanceBuffer - h3d.impl
- MacroHelper - h3d.impl
- MemoryManager - h3d.impl
- NullDriver - h3d.impl
- Query - h3d.impl
- QueryKind - h3d.impl
- RenderContext - h3d.impl
- RenderFlag - h3d.impl
- RendererFX - h3d.impl
- ShaderCache - h3d.impl
- StackStats - h3d.impl
- Step - h3d.impl
- Texture - h3d.impl
- TextureCache - h3d.impl
- TextureStat - h3d.impl
- VarBinding - h3d.impl
- mat
- noise
- BaseMaterial - h3d.mat
- BigTexture - h3d.mat
- BigTextureElement - h3d.mat
- Blend - h3d.mat
- BlendMode - h3d.mat
- Compare - h3d.mat
- Defaults - h3d.mat
- Face - h3d.mat
- Filter - h3d.mat
- Material - h3d.mat
- MaterialDatabase - h3d.mat
- MaterialSetup - h3d.mat
- MipMap - h3d.mat
- Operation - h3d.mat
- Pass - h3d.mat
- PbrBlend - h3d.mat
- PbrCullingMode - h3d.mat
- PbrDepthTest - h3d.mat
- PbrDepthWrite - h3d.mat
- PbrMaterial - h3d.mat
- PbrMaterialSetup - h3d.mat
- PbrMode - h3d.mat
- PbrProps - h3d.mat
- PbrStencilCompare - h3d.mat
- PbrStencilOp - h3d.mat
- Stencil - h3d.mat
- StencilOp - h3d.mat
- Texture - h3d.mat
- Texture3D - h3d.mat
- TextureArray - h3d.mat
- TextureChannels - h3d.mat
- TextureFlags - h3d.mat
- TextureFormat - h3d.mat
- Wrap - h3d.mat
- parts
- BlendMode - h3d.parts
- Collider - h3d.parts
- ColorKey - h3d.parts
- Converge - h3d.parts
- Emitter - h3d.parts
- GpuEmitMode - h3d.parts
- GpuPart - h3d.parts
- GpuPartGroup - h3d.parts
- GpuParticles - h3d.parts
- GpuSave - h3d.parts
- GpuSortMode - h3d.parts
- Particle - h3d.parts
- Particles - h3d.parts
- Randomized - h3d.parts
- Shape - h3d.parts
- SortMode - h3d.parts
- State - h3d.parts
- Value - h3d.parts
- ValueXYZ - h3d.parts
- pass
- ArrayCopy - h3d.pass
- Blur - h3d.pass
- Border - h3d.pass
- CapsuleShadowMap - h3d.pass
- CascadeCamera - h3d.pass
- CascadeParams - h3d.pass
- CascadeShadowMap - h3d.pass
- ColorMatrix - h3d.pass
- ColorMatrixShader - h3d.pass
- Copy - h3d.pass
- CubeCopy - h3d.pass
- CubeFaceFlag - h3d.pass
- CubeShadowMap - h3d.pass
- DefaultShadowMap - h3d.pass
- DirShadowMap - h3d.pass
- FXAA - h3d.pass
- Outline - h3d.pass
- Output - h3d.pass
- OutputShader - h3d.pass
- PassList - h3d.pass
- PassListIterator - h3d.pass
- PassObject - h3d.pass
- PointShadowMap - h3d.pass
- RenderMode - h3d.pass
- ScalableAO - h3d.pass
- ScreenFx - h3d.pass
- ShadowSamplingKind - h3d.pass
- Shadows - h3d.pass
- SortByMaterial - h3d.pass
- SpotShadowMap - h3d.pass
- prim
- BigPrimitive - h3d.prim
- Blendshape - h3d.prim
- Capsule - h3d.prim
- Collider - h3d.prim
- Cube - h3d.prim
- Cylinder - h3d.prim
- Disc - h3d.prim
- DynamicPrimitive - h3d.prim
- GeoSphere - h3d.prim
- Grid - h3d.prim
- HMDModel - h3d.prim
- HideProps - h3d.prim
- Instanced - h3d.prim
- MeshPrimitive - h3d.prim
- ModelCache - h3d.prim
- ModelDataInput - h3d.prim
- ModelDatabase - h3d.prim
- Plane2D - h3d.prim
- Polygon - h3d.prim
- Primitive - h3d.prim
- Quads - h3d.prim
- RawPrimitive - h3d.prim
- Sphere - h3d.prim
- UV - h3d.prim
- scene
- fwd
- pbr
- CapsuleLight - h3d.scene.pbr
- CubeToPanorama - h3d.scene.pbr
- Decal - h3d.scene.pbr
- DepthCopy - h3d.scene.pbr
- DirLight - h3d.scene.pbr
- DisplayMode - h3d.scene.pbr
- Environment - h3d.scene.pbr
- IrradBase - h3d.scene.pbr
- IrradLut - h3d.scene.pbr
- IrradShader - h3d.scene.pbr
- Light - h3d.scene.pbr
- LightBuffer - h3d.scene.pbr
- LightSystem - h3d.scene.pbr
- PanoramaToCube - h3d.scene.pbr
- PointLight - h3d.scene.pbr
- RenderProps - h3d.scene.pbr
- Renderer - h3d.scene.pbr
- SkyMode - h3d.scene.pbr
- SpotLight - h3d.scene.pbr
- TonemapMap - h3d.scene.pbr
- AnimMeshBatch - h3d.scene
- AnimMeshBatchShader - h3d.scene
- AnimMeshBatcher - h3d.scene
- BatchData - h3d.scene
- Box - h3d.scene
- CameraController - h3d.scene
- Capsule - h3d.scene
- DynamicJointData - h3d.scene
- Graphics - h3d.scene
- HierarchicalWorld - h3d.scene
- Interactive - h3d.scene
- Joint - h3d.scene
- JointData - h3d.scene
- Light - h3d.scene
- LightSystem - h3d.scene
- Mesh - h3d.scene
- MeshBatch - h3d.scene
- MeshBatchFlag - h3d.scene
- MeshBatchPart - h3d.scene
- MultiMaterial - h3d.scene
- Object - h3d.scene
- ObjectFlags - h3d.scene
- OptAlgorithm - h3d.scene
- PassObjects - h3d.scene
- RenderContext - h3d.scene
- RenderMode - h3d.scene
- Renderer - h3d.scene
- Scene - h3d.scene
- Skin - h3d.scene
- Sphere - h3d.scene
- Trail - h3d.scene
- World - h3d.scene
- WorldChunk - h3d.scene
- WorldData - h3d.scene
- WorldElement - h3d.scene
- WorldMaterial - h3d.scene
- WorldModel - h3d.scene
- WorldModelGeometry - h3d.scene
- shader
- pbr
- AlphaMultiply - h3d.shader.pbr
- BDRF - h3d.shader.pbr
- BaseDecal - h3d.shader.pbr
- CapsuleLight - h3d.shader.pbr
- CubeLod - h3d.shader.pbr
- DebugMode - h3d.shader.pbr
- DecalOverlay - h3d.shader.pbr
- DecalPBR - h3d.shader.pbr
- DefaultForward - h3d.shader.pbr
- DirLight - h3d.shader.pbr
- Direct - h3d.shader.pbr
- Distortion - h3d.shader.pbr
- GammaCorrect - h3d.shader.pbr
- Indirect - h3d.shader.pbr
- Light - h3d.shader.pbr
- LightEvaluation - h3d.shader.pbr
- Performance - h3d.shader.pbr
- PerformanceViewer - h3d.shader.pbr
- PointLight - h3d.shader.pbr
- PropsDefinition - h3d.shader.pbr
- PropsImport - h3d.shader.pbr
- PropsTexture - h3d.shader.pbr
- PropsValues - h3d.shader.pbr
- Slides - h3d.shader.pbr
- SpotLight - h3d.shader.pbr
- StrengthValues - h3d.shader.pbr
- ToneMapping - h3d.shader.pbr
- AlphaChannel - h3d.shader
- AlphaMSDF - h3d.shader
- AlphaMap - h3d.shader
- AlphaMult - h3d.shader
- AmbientLight - h3d.shader
- AnimatedTexture - h3d.shader
- Base2d - h3d.shader
- BaseMesh - h3d.shader
- Bloom - h3d.shader
- Blur - h3d.shader
- BufferKind - h3d.shader
- Buffers - h3d.shader
- CascadeShadow - h3d.shader
- Checker - h3d.shader
- CheckerboardDepth - h3d.shader
- ColorAdd - h3d.shader
- ColorKey - h3d.shader
- ColorMatrix - h3d.shader
- ColorMult - h3d.shader
- ColorSpaces - h3d.shader
- CubeMap - h3d.shader
- CubeMinMaxShader - h3d.shader
- DepthAwareUpsampling - h3d.shader
- DirLight - h3d.shader
- DirShadow - h3d.shader
- Displacement - h3d.shader
- DisplacementDisplay - h3d.shader
- DistanceFade - h3d.shader
- FixedColor - h3d.shader
- FlipBackFaceNormal - h3d.shader
- GenTexture - h3d.shader
- GpuParticle - h3d.shader
- InstanceIndirect - h3d.shader
- KillAlpha - h3d.shader
- LineShader - h3d.shader
- MinMaxShader - h3d.shader
- NoiseLib - h3d.shader
- NormalMap - h3d.shader
- Outline - h3d.shader
- Outline2D - h3d.shader
- Parallax - h3d.shader
- ParticleShader - h3d.shader
- PointLight - h3d.shader
- PointShadow - h3d.shader
- SAO - h3d.shader
- ScreenShader - h3d.shader
- ShaderBufferData - h3d.shader
- ShaderBuffers - h3d.shader
- Shadow - h3d.shader
- SignedDistanceField - h3d.shader
- SinusDeform - h3d.shader
- Skin - h3d.shader
- SkinBase - h3d.shader
- SkinTangent - h3d.shader
- SpecularTexture - h3d.shader
- SpotShadow - h3d.shader
- Texture - h3d.shader
- Texture2 - h3d.shader
- UVAnim - h3d.shader
- UVDelta - h3d.shader
- UVScroll - h3d.shader
- Utils - h3d.shader
- VertexColor - h3d.shader
- VertexColorAlpha - h3d.shader
- VolumeDecal - h3d.shader
- WhiteAlpha - h3d.shader
- ZCut - h3d.shader
- pbr
- Buffer - h3d
- BufferFlag - h3d
- Camera - h3d
- ColorAdjust - h3d
- DepthBinding - h3d
- Engine - h3d
- IDrawable - h3d
- Indexes - h3d
- Matrix - h3d
- MatrixImpl - h3d
- Quat - h3d
- Vector - h3d
- Vector4 - h3d
- Vector4Impl - h3d
- VectorImpl - h3d
- anim
- hxd
- clipper
- earcut
- fmt
- bfnt
- blend
- fbx
- grd
- hbson
- hdr
- hmd
- Animation - hxd.fmt.hmd
- AnimationEvent - hxd.fmt.hmd
- AnimationFlag - hxd.fmt.hmd
- AnimationObject - hxd.fmt.hmd
- BlendShape - hxd.fmt.hmd
- Collider - hxd.fmt.hmd
- Data - hxd.fmt.hmd
- DataPosition - hxd.fmt.hmd
- Dump - hxd.fmt.hmd
- Geometry - hxd.fmt.hmd
- GeometryBuffer - hxd.fmt.hmd
- GeometryDataFormat - hxd.fmt.hmd
- GeometryFormat - hxd.fmt.hmd
- Index - hxd.fmt.hmd
- Library - hxd.fmt.hmd
- Material - hxd.fmt.hmd
- Model - hxd.fmt.hmd
- Position - hxd.fmt.hmd
- Properties - hxd.fmt.hmd
- Property - hxd.fmt.hmd
- Reader - hxd.fmt.hmd
- Skin - hxd.fmt.hmd
- SkinJoint - hxd.fmt.hmd
- SkinSplit - hxd.fmt.hmd
- Writer - hxd.fmt.hmd
- kframes
- pak
- spine
- Animation - hxd.fmt.spine
- AnimationCurve - hxd.fmt.spine
- Attachment - hxd.fmt.spine
- Bone - hxd.fmt.spine
- BoneCurve - hxd.fmt.spine
- JAnimation - hxd.fmt.spine
- JAttachment - hxd.fmt.spine
- JBone - hxd.fmt.spine
- JBoneAnimation - hxd.fmt.spine
- JCurve - hxd.fmt.spine
- JRegionAttach - hxd.fmt.spine
- JSkeleton - hxd.fmt.spine
- JSkin - hxd.fmt.spine
- JSkinMeshAttach - hxd.fmt.spine
- JSlot - hxd.fmt.spine
- JsonData - hxd.fmt.spine
- Library - hxd.fmt.spine
- RegionAttachment - hxd.fmt.spine
- Skin - hxd.fmt.spine
- SkinnedMeshAttachment - hxd.fmt.spine
- SkinnedVertice - hxd.fmt.spine
- Slot - hxd.fmt.spine
- tiff
- fs
- impl
- AllocPos - hxd.impl
- Allocator - hxd.impl
- AnyProps - hxd.impl
- ArrayBuffer - hxd.impl
- ArrayBufferView - hxd.impl
- ArrayIterator - hxd.impl
- AsyncLoader - hxd.impl
- BitSet - hxd.impl
- BufferFlags - hxd.impl
- CacheAllocator - hxd.impl
- FIFOBufferAllocator - hxd.impl
- Float32 - hxd.impl
- Float32Array - hxd.impl
- Int16Array - hxd.impl
- MouseMode - hxd.impl
- Properties - hxd.impl
- UInt16 - hxd.impl
- Uint16Array - hxd.impl
- Uint32Array - hxd.impl
- Uint8Array - hxd.impl
- UncheckedBytes - hxd.impl
- net
- poly2tri
- AdvancingFront - hxd.poly2tri
- Basin - hxd.poly2tri
- Constants - hxd.poly2tri
- Edge - hxd.poly2tri
- EdgeEvent - hxd.poly2tri
- Node - hxd.poly2tri
- Orientation - hxd.poly2tri
- Point - hxd.poly2tri
- Sweep - hxd.poly2tri
- SweepContext - hxd.poly2tri
- Triangle - hxd.poly2tri
- Unit - hxd.poly2tri
- Utils - hxd.poly2tri
- VisiblePolygon - hxd.poly2tri
- res
- AnimGraph - hxd.res
- Any - hxd.res
- Atlas - hxd.res
- BDFFont - hxd.res
- BDFFontChar - hxd.res
- BitmapFont - hxd.res
- DefaultFont - hxd.res
- DynamicText - hxd.res
- DynamicTextMeta - hxd.res
- DynamicTextMetaContent - hxd.res
- Embed - hxd.res
- EmbedOptions - hxd.res
- Filter - hxd.res
- Font - hxd.res
- FontBuildOptions - hxd.res
- FontBuilder - hxd.res
- Gradients - hxd.res
- Image - hxd.res
- ImageFormat - hxd.res
- ImageInfo - hxd.res
- ImageInfoFlag - hxd.res
- Key - hxd.res
- Loader - hxd.res
- Model - hxd.res
- NanoJpeg - hxd.res
- NoArg - hxd.res
- NotFound - hxd.res
- Prefab - hxd.res
- Resource - hxd.res
- Sound - hxd.res
- SoundFormat - hxd.res
- TiledMap - hxd.res
- TiledMapData - hxd.res
- TiledMapLayer - hxd.res
- snd
- effect
- webaudio
- Buffer - hxd.snd
- BufferHandle - hxd.snd
- Channel - hxd.snd
- ChannelBase - hxd.snd
- ChannelGroup - hxd.snd
- Data - hxd.snd
- Driver - hxd.snd
- DriverFeature - hxd.snd
- Effect - hxd.snd
- EffectDriver - hxd.snd
- Listener - hxd.snd
- LoadingData - hxd.snd
- Manager - hxd.snd
- Mp3Data - hxd.snd
- NativeChannel - hxd.snd
- OggData - hxd.snd
- SampleFormat - hxd.snd
- SoundGroup - hxd.snd
- Source - hxd.snd
- SourceHandle - hxd.snd
- WavData - hxd.snd
- App - hxd
- BitmapData - hxd
- BitmapInnerData - hxd
- BrowseOptions - hxd
- BrowseSelect - hxd
- BufferFormat - hxd
- BufferInput - hxd
- BufferMapping - hxd
- ByteConversions - hxd
- BytesBuffer - hxd
- Channel - hxd
- Charset - hxd
- Cursor - hxd
- CustomCursor - hxd
- Direction - hxd
- DisplayMode - hxd
- DropFileEvent - hxd
- DroppedFile - hxd
- Event - hxd
- EventKind - hxd
- File - hxd
- Flags - hxd
- FloatBuffer - hxd
- IndexBuffer - hxd
- InputFormat - hxd
- Interactive - hxd
- InteractiveScene - hxd
- Key - hxd
- Math - hxd
- MultiFormat - hxd
- MultiFormatCache - hxd
- Pad - hxd
- PadConfig - hxd
- Perlin - hxd
- PixelFormat - hxd
- Pixels - hxd
- PixelsARGB - hxd
- PixelsFloat - hxd
- PixelsFloatRGBA - hxd
- Platform - hxd
- Precision - hxd
- Rand - hxd
- Save - hxd
- SceneEvents - hxd
- System - hxd
- SystemValue - hxd
- Timer - hxd
- WaitEvent - hxd
- Window - hxd
- hxsl
- ARead - hxsl
- AllocGlobal - hxsl
- AllocParam - hxsl
- BVec - hxsl
- BatchInstanceParams - hxsl
- BatchShader - hxsl
- Binop - hxsl
- BlockType - hxsl
- Buffer - hxsl
- BufferKind - hxsl
- Cache - hxsl
- Channel - hxsl
- ChannelTexture - hxsl
- ChannelTools - hxsl
- Checker - hxsl
- Clone - hxsl
- Component - hxsl
- Const - hxsl
- Dce - hxsl
- Debug - hxsl
- DynamicShader - hxsl
- Error - hxsl
- Eval - hxsl
- Expr - hxsl
- ExprDef - hxsl
- Flatten - hxsl
- FunDecl - hxsl
- FunType - hxsl
- FunctionKind - hxsl
- GlobalSlot - hxsl
- Globals - hxsl
- GlslOut - hxsl
- HlslOut - hxsl
- IVec - hxsl
- LinkMode - hxsl
- Linker - hxsl
- MacroParser - hxsl
- Matrix - hxsl
- NXGlslOut - hxsl
- Output - hxsl
- Position - hxsl
- Prec - hxsl
- Printer - hxsl
- RuntimeShader - hxsl
- RuntimeShaderData - hxsl
- Samplers - hxsl
- SearchMap - hxsl
- Serializer - hxsl
- Shader - hxsl
- ShaderConst - hxsl
- ShaderData - hxsl
- ShaderGlobal - hxsl
- ShaderInstance - hxsl
- ShaderInstanceDesc - hxsl
- ShaderList - hxsl
- SharedShader - hxsl
- SizeDecl - hxsl
- Splitter - hxsl
- SyntaxArg - hxsl
- SyntaxArgAccess - hxsl
- TExpr - hxsl
- TExprDef - hxsl
- TFunction - hxsl
- TGlobal - hxsl
- TVar - hxsl
- TexDimension - hxsl
- Texture - hxsl
- TextureArray - hxsl
- TextureChannel - hxsl
- Tools - hxsl
- Tools2 - hxsl
- Tools3 - hxsl
- Tools4 - hxsl
- Type - hxsl
- Unop - hxsl
- VarDecl - hxsl
- VarKind - hxsl
- VarQualifier - hxsl
- Vec - hxsl
- Vec4 - hxsl
- VecType - hxsl
View source
class DefaultForward
package h3d.shader.pbr
extends Shader
@:directlyUsed@:src({ @global var camera:{ var view : Mat4; var viewProj : Mat4; var position : Vec3; var inverseViewProj : Mat4}; @const(4) var CASCADE_COUNT:Int; @const(2) var DIR_SHADOW_COUNT:Int; @const(16) var POINT_SHADOW_COUNT:Int; @const(16) var SPOT_SHADOW_COUNT:Int; @:import h3d.shader.pbr.Light.LightEvaluation; @:import h3d.shader.pbr.BDRF; var output:{ var color : Vec4; var metalness : Float; var roughness : Float; var occlusion : Float; var emissive : Float; var depth : Float}; @const(256) var BUFFER_SIZE:Int = 1; @param var lightInfos:Buffer<Vec4,BUFFER_SIZE>; @param var dirLightCount:Int; @param var pointLightCount:Int; @param var spotLightCount:Int; @param var dirLightStride:Int; @param var pointLightStride:Int; @param var spotLightStride:Int; @param var cascadeShadowMaps:Array<Sampler2D,CASCADE_COUNT>; @param var dirShadowMaps:Array<Sampler2D,DIR_SHADOW_COUNT>; @param var pointShadowMaps:Array<SamplerCube,POINT_SHADOW_COUNT>; @param var spotShadowMaps:Array<Sampler2D,SPOT_SHADOW_COUNT>; @param var cameraPosition:Vec3; @param var emissivePower:Float; var albedoGamma:Vec3; var view:Vec3; var NdV:Float; var pbrSpecularColor:Vec3; var metalness:Float; var roughness:Float; var occlusion:Float; var emissive:Float; var F0:Vec3; @const var USE_INDIRECT = false; @param var irrLut:Sampler2D; @param var irrDiffuse:SamplerCube; @param var irrSpecular:SamplerCube; @param var irrSpecularLevels:Float; @param var irrPower:Float; @param var irrRotation:Vec2; var transformedNormal:Vec3; var transformedPosition:Vec3; var pixelColor:Vec4; var depth:Float; function rotateNormal(n:Vec3):Vec3 { return vec3(n.x * irrRotation.x - n.y * irrRotation.y, n.x * irrRotation.y + n.y * irrRotation.x, n.z); }; function indirectLighting():Vec3 { var F = F0 + (max(vec3(1 - roughness), F0) - F0) * exp2((-5.55473 * NdV - 6.98316) * NdV); var rotatedNormal = rotateNormal(transformedNormal); var diffuse = irrDiffuse.get(rotatedNormal).rgb * albedoGamma; var reflectVec = reflect(-view, transformedNormal); var rotatedReflecVec = rotateNormal(reflectVec); var envSpec = textureLod(irrSpecular, rotatedReflecVec, roughness * irrSpecularLevels).rgb; var envBRDF = irrLut.get(vec2(roughness, NdV)); var specular = envSpec * (F * envBRDF.x + envBRDF.y); var indirect = (diffuse * (1 - metalness) * (1 - F) + specular) * irrPower; return indirect * occlusion; }; function directLighting(lightColor:Vec3, lightDirection:Vec3):Vec3 { var result = vec3(0); var NdL = clamp(transformedNormal.dot(lightDirection), 0.0, 1.0); if (lightColor.dot(lightColor) > 0.0001 && NdL > 0) { var half = (lightDirection + view).normalize(); var NdH = clamp(transformedNormal.dot(half), 0.0, 1.0); var VdH = clamp(view.dot(half), 0.0, 1.0); var diffuse = albedoGamma / PI; var D = normalDistributionGGX(NdH, roughness); var F = fresnelSchlick(VdH, F0); var G = geometrySchlickGGX(NdV, NdL, roughness); var specular = (D * F * G).max(0.); result = (diffuse * (1 - metalness) * (1 - F) + specular) * lightColor * NdL; }; return result; }; function __init__fragment() { pbrSpecularColor = vec3(0.04); albedoGamma = pixelColor.rgb * pixelColor.rgb; }; function init() { view = (cameraPosition - transformedPosition).normalize(); NdV = transformedNormal.dot(view).max(0.); }; function evaluateDirShadow(index:Int):Float { var i = index * 5; var shadow = 1.0; if (lightInfos[i].a > 0) { var shadowBias = lightInfos[i + 1].a; var shadowProj = mat3x4(lightInfos[i + 2], lightInfos[i + 3], lightInfos[i + 4]); var shadowPos = transformedPosition * shadowProj; var shadowUv = screenToUv(shadowPos.xy); var depth = dirShadowMaps[index].get(shadowUv.xy).r; shadow = (shadowPos.z - shadowBias > depth) ? 0.0 : 1.0; }; return shadow; }; function evaluateDirLight(index:Int):Vec3 { var i = index * 5; var lightColor = lightInfos[i].rgb; var lightDir = lightInfos[i + 1].xyz; return directLighting(lightColor, lightDir); }; function evaluatePointShadow(index:Int):Float { var i = index * 3 + dirLightStride; var shadow = 1.0; if (lightInfos[i + 2].g > 0) { var lightPos = lightInfos[i + 1].rgb; var range = lightInfos[i + 2].r; var shadowBias = lightInfos[i + 2].b; var posToLight = transformedPosition.xyz - lightPos; var dir = normalize(posToLight.xyz); var depth = pointShadowMaps[index].getLod(dir, 0).r * range; var zMax = length(posToLight); shadow = (zMax - shadowBias > depth) ? 0.0 : 1.0; }; return shadow; }; function evaluatePointLight(index:Int):Vec3 { var i = index * 3 + dirLightStride; var lightColor = lightInfos[i].rgb; var size = lightInfos[i].a; var lightPos = lightInfos[i + 1].rgb; var invRange4 = lightInfos[i + 1].a; var delta = lightPos - transformedPosition; return directLighting(pointLightIntensity(delta, size, invRange4) * lightColor, delta.normalize()); }; function evaluateSpotShadow(index:Int):Float { var i = index * 8 + dirLightStride + pointLightStride; var shadow = 1.0; if (lightInfos[i + 3].b > 0) { var shadowBias = lightInfos[i + 3].a; var shadowProj = mat4(lightInfos[i + 4], lightInfos[i + 5], lightInfos[i + 6], lightInfos[i + 7]); var shadowPos = vec4(transformedPosition, 1.0) * shadowProj; shadowPos.xyz /= shadowPos.w; var shadowUv = screenToUv(shadowPos.xy); var depth = spotShadowMaps[index].get(shadowUv.xy).r; shadow = (shadowPos.z - shadowBias > depth) ? 0.0 : 1.0; }; return shadow; }; function evaluateSpotLight(index:Int):Vec3 { var i = index * 8 + dirLightStride + pointLightStride; var lightColor = lightInfos[i].rgb; var range = lightInfos[i].a; var lightPos = lightInfos[i + 1].xyz; var invRange4 = lightInfos[i + 1].a; var lightDir = lightInfos[i + 2].xyz; var angle = lightInfos[i + 3].r; var fallOff = lightInfos[i + 3].g; var delta = lightPos - transformedPosition; var fallOffInfo = spotLightIntensity(delta, lightDir, range, invRange4, fallOff, angle); var fallOff = fallOffInfo.x; var fallOffInfoAngle = fallOffInfo.y; return directLighting(fallOff * lightColor * fallOffInfoAngle, delta.normalize()); }; function evaluateCascadeLight():Vec3 { var i = dirLightStride + pointLightStride + spotLightStride; var lightColor = lightInfos[i].rgb; var lightDir = lightInfos[i + 1].xyz; return directLighting(lightColor, lightDir); }; function inside(pos:Vec3):Bool { if (abs(pos.x) < 1.0 && abs(pos.y) < 1.0 && abs(pos.z) < 1.0) return true else return false; }; function evaluateCascadeShadow():Float { var i = dirLightStride + pointLightStride + spotLightStride; var shadow = 1.0; var shadowProj = mat3x4(lightInfos[i + 2], lightInfos[i + 3], lightInfos[i + 4]); @unroll for (c in 0 ... CASCADE_COUNT) { var cascadeScale = lightInfos[i + 5 + 2 * c]; var shadowPos0 = transformedPosition * shadowProj; var shadowPos = c == 0 ? shadowPos0 : shadowPos0 * cascadeScale.xyz + lightInfos[i + 6 + 2 * c].xyz; if (inside(shadowPos)) { var zMax = saturate(shadowPos.z); var shadowUv = shadowPos.xy; shadowUv.y = 1.0 - shadowUv.y; var depth = cascadeShadowMaps[c].get(shadowUv.xy).r; shadow -= zMax > depth ? 1.0 : 0.0; }; }; return saturate(shadow); }; function evaluateLighting():Vec3 { var lightAccumulation = vec3(0); F0 = mix(pbrSpecularColor, albedoGamma, metalness); @unroll for (l in 0 ... DIR_SHADOW_COUNT) { var c = evaluateDirLight(l); if (dot(c, c) > 1e-6) c *= evaluateDirShadow(l); lightAccumulation += c; }; var start = DIR_SHADOW_COUNT; if (CASCADE_COUNT > 0) start++; @unroll for (l in start ... dirLightCount + DIR_SHADOW_COUNT) lightAccumulation += evaluateDirLight(l); @unroll for (l in 0 ... POINT_SHADOW_COUNT) { var c = evaluatePointLight(l); if (dot(c, c) > 1e-6) c *= evaluatePointShadow(l); lightAccumulation += c; }; @unroll for (l in POINT_SHADOW_COUNT ... pointLightCount + POINT_SHADOW_COUNT) lightAccumulation += evaluatePointLight(l); @unroll for (l in 0 ... SPOT_SHADOW_COUNT) { var c = evaluateSpotLight(l); if (dot(c, c) > 1e-6) c *= evaluateSpotShadow(l); lightAccumulation += c; }; @unroll for (l in SPOT_SHADOW_COUNT ... spotLightCount + SPOT_SHADOW_COUNT) lightAccumulation += evaluateSpotLight(l); if (CASCADE_COUNT > 0) { var c = evaluateCascadeLight(); if (dot(c, c) > 1e-6) c *= evaluateCascadeShadow(); lightAccumulation += c; }; if (USE_INDIRECT) lightAccumulation += indirectLighting(); lightAccumulation += emissive * emissivePower * pixelColor.rgb; return lightAccumulation; }; function fragment() { init(); output.color = vec4(evaluateLighting(), pixelColor.a); output.depth = depth; }; })@:build(hxsl.Macros.buildShader())@:autoBuild(hxsl.Macros.buildShader())Constructor
Variables
Methods
Inherited Variables
Inherited Methods
Defined by Shader
setPriority(v:Int):Void
Shader priority should only be changed before the shader is added to a material.