Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/renderer/InstancingModelRenderer.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | void InstancingModelRenderer::PrepareModelDef(const CShaderProgramPtr& shader, int streamflags, const CModelDef& def) | ||||
shader->AssertPointersBound(); | shader->AssertPointersBound(); | ||||
} | } | ||||
// Render one model | // Render one model | ||||
void InstancingModelRenderer::RenderModel(const CShaderProgramPtr& shader, int UNUSED(streamflags), CModel* model, CModelRData* UNUSED(data)) | void InstancingModelRenderer::RenderModel(const CShaderProgramPtr& shader, int UNUSED(streamflags), CModel* model, CModelRData* UNUSED(data)) | ||||
{ | { | ||||
CModelDefPtr mdldef = model->GetModelDef(); | const CModelDefPtr& mdldef = model->GetModelDef(); | ||||
if (m->gpuSkinning) | if (m->gpuSkinning) | ||||
{ | { | ||||
// Bind matrices for current animation state. | // Bind matrices for current animation state. | ||||
// Add 1 to NumBones because of the special 'root' bone. | // Add 1 to NumBones because of the special 'root' bone. | ||||
// HACK: NVIDIA drivers return uniform name with "[0]", Intel Windows drivers without; | // HACK: NVIDIA drivers return uniform name with "[0]", Intel Windows drivers without; | ||||
// try uploading both names since one of them should work, and this is easier than | // try uploading both names since one of them should work, and this is easier than | ||||
// canonicalising the uniform names in CShaderProgramGLSL | // canonicalising the uniform names in CShaderProgramGLSL | ||||
Show All 23 Lines |
Wildfire Games · Phabricator