1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- Texture2D shaderTexture : register(t0);
- SamplerState SampleType : register(s0);
- struct MatrixBuffer
- {
- matrix knochenMatrix[128];
- };
- struct KameraBuffer
- {
- matrix view;
- matrix projection;
- };
- struct KameraBuffer2
- {
- float4 kPosition;
- };
- struct Material
- {
- float ambientFactor;
- float diffusFactor;
- float specularFactor;
- };
- struct LightCount
- {
- int diffuseLightCount;
- int pointLightCount;
- };
- ConstantBuffer<KameraBuffer> Kamera : register(b0);
- ConstantBuffer<MatrixBuffer> Skelett : register(b1);
- ConstantBuffer<KameraBuffer2> Kamera2 : register(b2);
- ConstantBuffer<Material> Object : register(b3);
- ConstantBuffer<LightCount> Light : register(b4);
- struct VertexInputType
- {
- float3 position : POSITION;
- float2 tex : TEXCOORD;
- float3 normal : NORMAL;
- uint knochen : KNOCHEN_ID;
- uint id : VERTEX_ID;
- };
- struct PixelInputType
- {
- float4 worldPos : POSITION;
- float4 position : SV_POSITION;
- float2 tex : TEXCOORD;
- float3 normal : NORMAL;
- };
- PixelInputType main(VertexInputType input)
- {
-
- PixelInputType output;
- output.normal = normalize(mul(input.normal, (float3x3)Skelett.knochenMatrix[input.knochen]));
-
- float4 position = float4(input.position.x, input.position.y, input.position.z, 1.f);
-
- output.tex = input.tex;
-
- output.worldPos = mul(position, Skelett.knochenMatrix[input.knochen]);
- output.position = mul(output.worldPos, Kamera.view);
- output.position = mul(output.position, Kamera.projection);
- return output;
- }
|