Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/ParticleRenderer.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | void ParticleRenderer::PrepareForRendering(const CShaderDefines& context) | ||||
PROFILE3("prepare particles"); | PROFILE3("prepare particles"); | ||||
// Can't load the shader in the constructor because it's called before the | // Can't load the shader in the constructor because it's called before the | ||||
// renderer initialisation is complete, so load it the first time through here | // renderer initialisation is complete, so load it the first time through here | ||||
if (!m->shader) | if (!m->shader) | ||||
{ | { | ||||
// Only construct the shaders when shaders are supported and enabled; otherwise | // Only construct the shaders when shaders are supported and enabled; otherwise | ||||
// RenderParticles will never be called so it's safe to leave the shaders as null | // RenderParticles will never be called so it's safe to leave the shaders as null | ||||
if (g_Renderer.GetRenderPath() == CRenderer::RP_SHADER) | if (g_RenderingOptions.GetRenderPath() == RenderPath::SHADER) | ||||
{ | { | ||||
m->shader = g_Renderer.GetShaderManager().LoadEffect(str_particle, context, CShaderDefines()); | m->shader = g_Renderer.GetShaderManager().LoadEffect(str_particle, context, CShaderDefines()); | ||||
m->shaderSolid = g_Renderer.GetShaderManager().LoadEffect(str_particle_solid, context, CShaderDefines()); | m->shaderSolid = g_Renderer.GetShaderManager().LoadEffect(str_particle_solid, context, CShaderDefines()); | ||||
} | } | ||||
} | } | ||||
++m->frameNumber; | ++m->frameNumber; | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator