Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. cbuffer SkinningTransforms
  2. {
  3. matrix WorldMatrix;
  4. matrix ViewProjMatrix;
  5. };
  6. //--------------------------------------------------------------------------------
  7. // Inter-stage structures
  8. //--------------------------------------------------------------------------------
  9. struct VS_INPUT
  10. {
  11. float3 position : POSITION;
  12. int4 bone : BONEID;
  13. float4 weights : BONEWEIGHT;
  14. float3 normal : NORMAL;
  15. float3 tangent : TANGENT;
  16. float2 tex : TEXCOORD;
  17. };
  18. //--------------------------------------------------------------------------------
  19. struct VS_OUTPUT
  20. {
  21. float4 position : SV_Position;
  22. float3 normal : NORMAL;
  23. float3 light : LIGHT;
  24. float2 tex : TEXCOORDS;
  25. };
  26.  
  27. Texture2D ColorTexture : register( t0 );
  28. SamplerState LinearSampler : register( s0 );
  29.  
  30. //--------------------------------------------------------------------------------
  31. VS_OUTPUT VSMAIN( in VS_INPUT input )
  32. {
  33. VS_OUTPUT output;
  34. //Transform vertex and pass them to the pixel shader
  35. return output;
  36. }
  37.  
  38. //--------------------------------------------------------------------------------
  39. float4 PSMAIN( in VS_OUTPUT input ) : SV_Target
  40. {
  41. // Calculate the lighting
  42. float3 n = normalize( input.normal );
  43. float3 l = normalize( input.light );
  44.  
  45.  
  46. float4 texColor = ColorTexture.Sample( LinearSampler, input.tex );
  47.  
  48. float4 color = texColor * (max(dot(n,l),0) + 0.05f );
  49. return( color );
  50. }
  51.  
  52. 106:(obj:4) ID3D11Device::CreateDepthStencilView(obj:24,NULL,obj:25)*
  53. 108:(obj:5) ID3D11DeviceContext::OMSetRenderTargets(8,{obj:1,NULL,NULL,NULL,NULL,NULL,NULL,NULL},obj:25)*
  54. 109:(obj:5) ID3D11DeviceContext::ClearRenderTargetView(obj:1,addr:21)*
  55. 111:(obj:5) ID3D11DeviceContext::ClearDepthStencilView(obj:25,1,1.000f,0)*
  56. 119:(obj:4) ID3D11Device::CreateSamplerState(addr:24,obj:27)*
  57. 134:(obj:4) ID3D11Device::CreatePixelShader(addr:27,21056,NULL,obj:30)*
  58. 135:CreateObject(D3D11 Pixel Shader,obj:30)
  59. 136:(obj:5) ID3D11DeviceContext::PSSetShader(obj:30,NULL,0)*
  60. 137:(obj:5) ID3D11DeviceContext::PSSetSamplers(0,1,{obj:27})*
  61. 139:(obj:4) ID3D11Device::CreateTexture2D(addr:28,addr:5,obj:31)*
  62. 140:CreateObject(D3D11 Texture2D,obj:31)
  63. 142:(obj:4) ID3D11Device::CreateShaderResourceView(obj:31,NULL,obj:32)*
  64. 143:CreateObject(D3D11 Shader Resource View,obj:32)
  65. 144:(obj:5) ID3D11DeviceContext::PSSetShaderResources(0,1,{obj:32})*
  66. 146:(obj:4) ID3D11Device::CreateRasterizerState(addr:29,obj:33)*
  67. 147:CreateObject(D3D11 Rasterizer State,obj:33)
  68. 152:(obj:5) ID3D11DeviceContext::RSSetState(obj:33)*
  69. 154:(obj:5) ID3D11DeviceContext::RSSetViewports(1,addr:30)*
  70. 156:(obj:4) ID3D11Device::CreateBlendState(addr:11,obj:34)*
  71. 157:CreateObject(D3D11 Blend State,obj:34)
  72. 159:(obj:5) ID3D11DeviceContext::OMSetBlendState(obj:34,addr:31,-1)*
  73. 162:(obj:4) ID3D11Device::CreateDepthStencilState(addr:32,obj:35)*
  74. 163:CreateObject(D3D11 Depth-Stencil State,obj:35)
  75. 165:(obj:5) ID3D11DeviceContext::OMSetDepthStencilState(obj:35,0)*
  76.  
  77. float4 color = texColor * (max(dot(n,l),0) + 0.05f );
  78.  
  79. // At this point color.a could be zero which will make things transparent
  80. color.a = 1.0; // Could also use texColor.a
  81.  
  82. return( color );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement