| 129 | } |
| 130 | |
| 131 | void MeshRenderer::LoadShaders() |
| 132 | { |
| 133 | // Load the mesh shaders |
| 134 | meshDepthVS = CompileFromFile(L"DepthOnly.hlsl", "VS", ShaderType::Vertex, ShaderProfile::SM51); |
| 135 | |
| 136 | CompileOptions opts; |
| 137 | opts.Add("NumMaterialTextures_", uint32(model->MaterialTextures().Count())); |
| 138 | opts.Add("OutputUVGradients_", 1); |
| 139 | meshVS = CompileFromFile(L"Mesh.hlsl", "VS", ShaderType::Vertex, ShaderProfile::SM51, opts); |
| 140 | meshPSForward = CompileFromFile(L"Mesh.hlsl", "PSForward", ShaderType::Pixel, ShaderProfile::SM51, opts); |
| 141 | meshPSGBuffer[0] = CompileFromFile(L"Mesh.hlsl", "PSGBuffer", ShaderType::Pixel, ShaderProfile::SM51, opts); |
| 142 | |
| 143 | opts.Reset(); |
| 144 | opts.Add("NumMaterialTextures_", uint32(model->MaterialTextures().Count())); |
| 145 | opts.Add("OutputUVGradients_", 0); |
| 146 | meshPSGBuffer[1] = CompileFromFile(L"Mesh.hlsl", "PSGBuffer", ShaderType::Pixel, ShaderProfile::SM51, opts); |
| 147 | } |
| 148 | |
| 149 | // Loads resources |
| 150 | void MeshRenderer::Initialize(const Model* model_) |
nothing calls this directly
no test coverage detected