コード例 #1
0
ファイル: light.cpp プロジェクト: hextriclosan/tangram-es
void Light::injectOnProgram(std::shared_ptr<ShaderProgram> _shader) {

    // Inject all needed #defines for this light instance
    _shader->addSourceBlock("defines", getInstanceDefinesBlock(), false);

    _shader->addSourceBlock("__lighting", getClassBlock(), false);
    _shader->addSourceBlock("__lighting", getInstanceBlock());
    _shader->addSourceBlock("__lights_to_compute", getInstanceComputeBlock());

}
コード例 #2
0
void Light::injectSourceBlocks(ShaderProgram& _shader) {

    // Inject all needed #defines for this light instance
    _shader.addSourceBlock("defines", getInstanceDefinesBlock(), false);

    if (m_dynamic) {
        // If the light is dynamic, initialize it using the corresponding uniform at the start of main()
        _shader.addSourceBlock("setup", getInstanceName() + " = " + getUniformName() + ";", false);
    }

    _shader.addSourceBlock("__lighting", getClassBlock(), false);
    _shader.addSourceBlock("__lighting", getInstanceBlock());
    _shader.addSourceBlock("__lights_to_compute", getInstanceComputeBlock());
}
コード例 #3
0
ファイル: material.cpp プロジェクト: potatolicious/tangram-es
void Material::injectOnProgram(ShaderProgram& _shader ) {
    _shader.addSourceBlock("defines", getDefinesBlock(), false);
    _shader.addSourceBlock("material", getClassBlock(), false);
}