1 Year Ago
Shader-Pain branch This supersedes #645 Finally, blendable compiles again Update everything to use the new names but try not to break valves api in the process A flat out macro replacement breaks quite a bit of stuff unexpectedly and changes some APIs which happen to have the example same name as inputs & outputs. Doing this selectively prevents all those issues and keeps us in line for any future updates we get need this too Actually append an base VS & PS section if we don't have one Get rid of our old legacy instancing Revert "Get rid of xen animations" This reverts commit 84f51906057979ecc0db1577d6da9d30eafc1f70. Revert "Get rid of environmental interaction stuff too, it's unused so no point in having it" This reverts commit c78ca6f7d2778af2948ebc540745e23ca89e6ac8. Throw in an include which is defined post inputs for the includes which actually need a pixel input defined for function arguments Get rid of environmental interaction stuff too, it's unused so no point in having it Get rid of xen animations Rename all pixel/vertex struct members to simpler names. Allow API to handle both cases of the old & new name Remove #pragma optimize("", off) Allow procedural for both post processing and surface shaders Fix the remaining shaders with the new updates Move render states to ui/pixel.hlsl so we don't set them all the time manually Strip and cleanup UI shaders. Move all helper funcs to their own file instead of copy pasting them. Use our public facing names instead of internal names Fix optional entry points not being found when behind definition guard Initial work on cleaning up UI shaders Allow F_MORPH_SUPPORTED to finally be optional too Split surface.hlsl and surface.minimal.hlsl, fix GatherMaterial when not using texture inputs Reorganize again, allow having both pixel & vertex input independently optional Fix it so it compiles Optional entries for surface shading Create post_process.hlsl, provide default entry point for vertex and input The example post processing shader can now just be a pixel shader instead of everyone copying the exact same vertex shader all the time Add helpers for determining which shader stage we're processing Allow optional VS_INPUT and PS_INPUT, also allow optional entry points Fix the remaining shaders so they now compile Blendable compile fix Make HQ Reflections, ripplecompute & tiled light compile again Move triplanar to different file, we don't always define pixel input Fix DepthToRealDepthWorldUnits Oops Initial support for tri-plannar mapping in blendable. sboxgame/issues/issues/1003 Add Tex2DTriplanar for sampling with tri-plannar mapping Get rid of S_TRANSFORM_CONSTANT_BUFFER Allow fetching world mapping size within shaders Add CreateMaterial() for returning a struct with default parameters for a material Split texture & attribute inputs from the pixel include. Not every material should be forced to use Color, Normal, Roughness etc. Now there's the option of including just the APIs and not being forced to use specific attributes, features or textures Get rid of the last of our internal sbox_ includes Do the same for sbox_lighting, move to public Get rid of sbox_pixel.fxc, trim & move to public Start implementation of common helper functions people need for shaders - RemapDepthToViewport - DepthToApproximateWorldUnits - DepthToRealDepthWorldUnits - ReconstructPositionFromDepth Move shader includes into folders instead of long names in 1 folder Actually account for opacity in the shading models. Opacity now works for ShadingModelValveStandard Let high quality reflections propagate to all user shaders optionally since we can just check if a feature even exists now Trim a lot of features needed to be included, they're now optional instead of forced! Last one left is morph, still need to do some work to get rid of that one! https://files.facepunch.com/ognik/1b1011b1/sbox-dev_r0eCOvInhu.png F_ADDITIVE_BLEND is no longer mandatory for shaders Update all shaders Fix complex compile errors due to secondary UV truncation + parallax occlusion & detail textures Revert "debug prints" This reverts commit 637cd5109d557a230fd02d4828c726cc37a9da7d. Revert "more debug prints" This reverts commit fd9301e0773cf03e2c12117cac92ed6495aad25c. Update post_process.shader_c more debug prints debug prints Add FeatureExists preprocessor function, lets you check if a feature exists Drop additive blending combo from complex, make parallax occlusion replace it since it's an extra sampler Rebase fixes Allow us to reference features at runtime & set default values when they don't exist Built shaders for testing Add Parallax Occlusion to complex Return the full range of NdotL instead of the saturated version to allow for more lighting models out of the box Mark glow shaders as dev only Get rid of postprocess example, should be on the wiki Drop sys from Combos, this was removed with shader-assets and does nothing now Remove the needing to require special definitions when overwriting render states supersedes #648