yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
5398d55e
main
1#version 460 2uniform int uTDInstanceIDOffset ; 3uniform int uTDNumInstances ; 4uniform float uTDAlphaTestVal ; 5#define TD_NUM_COLOR_BUFFERS 1 6#define TD_NUM_LIGHTS 0 7#define TD_NUM_SHADOWED_LIGHTS 0 8#define TD_NUM_ENV_LIGHTS 0 9#define TD_LIGHTS_ARRAY_SIZE 1 10#define TD_ENV_LIGHTS_ARRAY_SIZE 1 11#define TD_NUM_CAMERAS 1 12struct TDPhongResult 13{ 14vec3 diffuse ; 15vec3 specular ; 16vec3 specular2 ; 17float shadowStrength ; 18}; 19struct TDPBRResult 20{ 21vec3 diffuse ; 22vec3 specular ; 23float shadowStrength ; 24}; 25struct TDMatrix 26{ 27mat4 world ; 28mat4 worldInverse ; 29mat4 worldCam ; 30mat4 worldCamInverse ; 31mat4 cam ; 32mat4 camInverse ; 33mat4 camProj ; 34mat4 camProjInverse ; 35mat4 proj ; 36mat4 projInverse ; 37mat4 worldCamProj ; 38mat4 worldCamProjInverse ; 39mat4 quadReproject ; 40mat3 worldForNormals ; 41mat3 camForNormals ; 42mat3 worldCamForNormals ; 43}; 44layout (std140 )uniform TDMatricesBlock { 45TDMatrix uTDMats [TD_NUM_CAMERAS ]; 46}; 47struct TDCameraInfo 48{ 49vec4 nearFar ; 50vec4 fog ; 51vec4 fogColor ; 52int renderTOPCameraIndex ; 53}; 54layout (std140 )uniform TDCameraInfoBlock { 55TDCameraInfo uTDCamInfos [TD_NUM_CAMERAS ]; 56}; 57struct TDGeneral 58{ 59vec4 ambientColor ; 60vec4 nearFar ; 61vec4 viewport ; 62vec4 viewportRes ; 63vec4 fog ; 64vec4 fogColor ; 65}; 66layout (std140 )uniform TDGeneralBlock { 67TDGeneral uTDGeneral ; 68}; 69layout (location = 0 )in vec3 P ; 70layout (location = 1 )in vec3 N ; 71layout (location = 2 )in vec4 Cd ; 72layout (location = 3 )in vec3 uv [8 ]; 73vec4 TDWorldToProj (vec4 v ); 74vec4 TDWorldToProj (vec3 v ); 75vec4 TDWorldToProj (vec4 v ,vec3 uv ); 76vec4 TDWorldToProj (vec3 v ,vec3 uv ); 77int TDInstanceID (); 78int TDCameraIndex (); 79vec3 TDUVUnwrapCoord (); 80/*********TOUCHDEFORMPREFIX**********/ 81#define TD_NUM_BONES 0 82 83vec3 TDInstanceTexCoord (int instanceID ,vec3 t ); 84vec4 TDInstanceColor (int instanceID ,vec4 curColor ); 85 86vec4 TDDeform (vec4 pos ); 87vec4 TDDeform (vec3 pos ); 88vec3 TDInstanceTexCoord (vec3 t ); 89vec4 TDInstanceColor (vec4 curColor ); 90#line 1 91 92out Vertex 93{ 94vec4 color ; 95vec3 worldSpacePos ; 96vec3 texCoord0 ; 97flat int cameraIndex ; 98flat int instance ; 99}oVert ; 100 101void main () 102{ 103 104 {// Avoid duplicate variable defs 105vec3 texcoord = TDInstanceTexCoord (uv [0 ]); 106oVert .texCoord0 .stp = texcoord .stp ; 107 } 108// First deform the vertex and normal 109// TDDeform always returns values in world space 110oVert .instance = TDInstanceID (); 111vec4 worldSpacePos = TDDeform (P ); 112vec3 uvUnwrapCoord = TDInstanceTexCoord (TDUVUnwrapCoord ()); 113gl_Position = TDWorldToProj (worldSpacePos ,uvUnwrapCoord ); 114 115 116// This is here to ensure we only execute lighting etc. code 117// when we need it. If picking is active we don't need lighting, so 118// this entire block of code will be ommited from the compile. 119// The TD_PICKING_ACTIVE define will be set automatically when 120// picking is active. 121 122int cameraIndex = TDCameraIndex (); 123oVert .cameraIndex = cameraIndex ; 124oVert .worldSpacePos .xyz = worldSpacePos .xyz ; 125oVert .color = TDInstanceColor (Cd ); 126}