mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'emission' argument to gfx.blockwraps.wrap
This commit is contained in:
parent
dfdc7ebf6b
commit
4d950c974e
3 changed files with 13 additions and 6 deletions
|
|
@ -57,7 +57,9 @@ void BlockWrapsRenderer::draw(BlockWrapper& wrapper, const Texture* texture) {
|
|||
glm::vec4 light(1, 1, 1, 0);
|
||||
if (wrapper.emission < 1.0f) {
|
||||
light = Lightmap::extractNormalized(chunks.getLight(wrapper.position));
|
||||
light = wrapper.emission + (1.0f - light);
|
||||
light.r += wrapper.emission;
|
||||
light.g += wrapper.emission;
|
||||
light.b += wrapper.emission;
|
||||
}
|
||||
switch (wrapper.modelType) {
|
||||
case BlockModelType::BLOCK:
|
||||
|
|
@ -150,11 +152,13 @@ void BlockWrapsRenderer::draw(const DrawContext& pctx, const Player& player) {
|
|||
}
|
||||
|
||||
u64id_t BlockWrapsRenderer::add(
|
||||
const glm::ivec3& position, const std::string& texture
|
||||
const glm::ivec3& position, const std::string& texture, float emission
|
||||
) {
|
||||
u64id_t id = nextWrapper++;
|
||||
wrappers[id] = std::make_unique<BlockWrapper>(BlockWrapper {
|
||||
position, {texture, texture, texture, texture, texture, texture}});
|
||||
position,
|
||||
{texture, texture, texture, texture, texture, texture},
|
||||
emission});
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue