Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Attempt to get shader from shader manager, if not present - create a new node and load the shader
- mShader = mRenderer->GetShaderManager()->GetNode("Wireframe");
- if (mShader == nullptr)
- {
- D3DShader* shader = new D3DShader(mLog, "../Data/Shaders/Geometry/Wireframe.hlsl",
- std::vector<D3DShader::ShaderEntryPoint>
- {
- Engine::D3DShader::ShaderEntryPoint(Engine::D3DShader::AMPLIFICATION_SHADER, L"AS"),
- Engine::D3DShader::ShaderEntryPoint(Engine::D3DShader::MESH_SHADER, L"MS"),
- Engine::D3DShader::ShaderEntryPoint(Engine::D3DShader::PIXEL_SHADER, L"PS")
- },
- std::vector<D3DShader::ShaderDefine>
- {
- Engine::D3DShader::ShaderDefine(L"USE_MESH_SHADERS", std::to_wstring(1)),
- Engine::D3DShader::ShaderDefine(L"VERTEX_SIZE", std::to_wstring(16)),
- Engine::D3DShader::ShaderDefine(L"VERTEX_POSITION_OFFSET", std::to_wstring(0)),
- Engine::D3DShader::ShaderDefine(L"VERTEX_TEXCOORD_OFFSET", std::to_wstring(12)),
- Engine::D3DShader::ShaderDefine(L"VERTEX_NORMAL_OFFSET", std::to_wstring(3)),
- Engine::D3DShader::ShaderDefine(L"VERTEX_TANGENT_OFFSET", std::to_wstring(6)),
- Engine::D3DShader::ShaderDefine(L"VERTEX_BITANGENT_OFFSET", std::to_wstring(9)),
- #ifdef USE_QUANTIZED_MESHLET_INDICES
- Engine::D3DShader::ShaderDefine(L"USE_QUANTIZED_MESHLET_INDICES", L"1"),
- #else
- Engine::D3DShader::ShaderDefine(L"USE_QUANTIZED_MESHLET_INDICES", L"0"),
- #endif
- Engine::D3DShader::ShaderDefine(L"DEBUG_CLUSTERS", L"0")
- });
- mRenderer->GetShaderManager()->Insert("Wireframe", shader);
- mShader = mRenderer->GetShaderManager()->GetNode("Wireframe");
- }
- mRenderer->RegisterShaderMapping(mShader->Get(), this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement