mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +00:00
add 'lighting-mode' entity property
This commit is contained in:
parent
507f32f1e5
commit
8911cded07
9 changed files with 61 additions and 18 deletions
|
|
@ -100,13 +100,18 @@ void ModelBatch::draw(
|
|||
void ModelBatch::draw(
|
||||
const glm::mat4& matrix,
|
||||
const glm::vec4& tint,
|
||||
const glm::vec3& lightSampleOffset,
|
||||
const model::Model* model,
|
||||
const TextureNamesMap* varTextures
|
||||
) {
|
||||
for (const auto& mesh : model->meshes) {
|
||||
entries.push_back({
|
||||
matrix, extract_rotation(matrix), tint, &mesh, varTextures
|
||||
});
|
||||
entries.push_back(DrawEntry {
|
||||
matrix,
|
||||
extract_rotation(matrix),
|
||||
tint,
|
||||
lightSampleOffset,
|
||||
&mesh,
|
||||
varTextures});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,6 +123,7 @@ void ModelBatch::render() {
|
|||
);
|
||||
bool backlight = settings.graphics.backlight.get();
|
||||
for (auto& entry : entries) {
|
||||
setLightsOffset(entry.lightSampleOffset);
|
||||
draw(
|
||||
*entry.mesh,
|
||||
entry.matrix,
|
||||
|
|
@ -126,6 +132,7 @@ void ModelBatch::render() {
|
|||
entry.varTextures,
|
||||
backlight
|
||||
);
|
||||
setLightsOffset(glm::vec3());
|
||||
}
|
||||
batch->flush();
|
||||
entries.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue