Advertisement
Zgragselus

Shader init

Oct 14th, 2024
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.39 KB | None | 0 0
  1.     mShader = mRenderer->GetShaderManager()->GetNode("Textured");
  2.     if (mShader == nullptr)
  3.     {
  4.         D3DShader* shader = new D3DShader(mLog, "../Data/Shaders/Geometry/Textured.hlsl",
  5.             std::vector<ShaderEntryPoint>
  6.             {
  7.                 Engine::ShaderEntryPoint(Engine::ShaderType::AMPLIFICATION_SHADER, L"AS"),
  8.                 Engine::ShaderEntryPoint(Engine::ShaderType::MESH_SHADER, L"MS"),
  9.                 Engine::ShaderEntryPoint(Engine::ShaderType::PIXEL_SHADER, L"PS")
  10.             },
  11.             std::vector<ShaderDefine>
  12.             {
  13.                 Engine::ShaderDefine(L"USE_MESH_SHADERS", std::to_wstring(1)),
  14.                 Engine::ShaderDefine(L"VERTEX_SIZE", std::to_wstring(16)),
  15.                 Engine::ShaderDefine(L"VERTEX_POSITION_OFFSET", std::to_wstring(0)),
  16.                 Engine::ShaderDefine(L"VERTEX_TEXCOORD_OFFSET", std::to_wstring(12)),
  17.                 Engine::ShaderDefine(L"VERTEX_NORMAL_OFFSET", std::to_wstring(3)),
  18.                 Engine::ShaderDefine(L"VERTEX_TANGENT_OFFSET", std::to_wstring(6)),
  19.                 Engine::ShaderDefine(L"VERTEX_BITANGENT_OFFSET", std::to_wstring(9)),
  20. #ifdef USE_QUANTIZED_MESHLET_INDICES
  21.                 Engine::ShaderDefine(L"USE_QUANTIZED_MESHLET_INDICES",  L"1"),
  22. #else
  23.                 Engine::ShaderDefine(L"USE_QUANTIZED_MESHLET_INDICES", L"0"),
  24. #endif
  25.                 Engine::ShaderDefine(L"DEBUG_CLUSTERS", L"0")
  26.             });
  27.         mRenderer->GetShaderManager()->Insert("Textured", shader);
  28.         mShader = mRenderer->GetShaderManager()->GetNode("Textured");
  29.     }
  30.     mRenderer->RegisterShaderMapping(mShader->Get(), this);
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement