Re: Ask a simple question, get a simple answer
Posted: Sun May 12, 2019 1:34 am
I guess I could just add another texture. My resource pack as is with out doing more optimization is around 200 MB. So I think I should be ok.
Official Legend of Grimrock Forums
http://grimrock.net/forum/
The fragment will still be lit as normal, but the emissive color will be added to the fragment's color at the end. So it's somewhat unfriendly with lighting but not necessarily unusable, depending on how much emissive color you're using and how heavily you expect the model to be lit.
While imperfect, it is possible to use negative emissive color values. It comes with visual side effects, but you can decide if it's a good trade-off, and you have precise control over the color values... to balance the tint effect with the off lighting. In the video, as you'll see, the trees in the center clearing are tinted red, blue, and green. The negative values [for the most part] don't cause them to glow in the dark.
It's not really a script per se—I mean technically it is. minmay shows it above.
Code: Select all
forest_oak_cluster_1.model:setEmissiveColor(vec(-.025))
forest_oak_cluster_2.model:setEmissiveColor(vec(-.01,-.005,-.05))
forest_oak_cluster_3.model:setEmissiveColor(vec(0,0,-.01))
forest_oak_cluster_4.model:setEmissiveColor(vec(-.025,-.01))
forest_oak_cluster_5.model:setEmissiveColor(vec(-.01,-.025,-.06))
Code: Select all
{
class = "Model",
model = "mod_assets/models/env/goat_statue.fbx",
emissiveColor = vec(0.04, -0.02, 0),
}
Code: Select all
defineObject{
name = "lava_effects",
components = {
{ class = "Light",
offset = vec(0, -0.5, 0),
range = 6,
color = vec(2.8, 1.2, 0.7),
brightness = 10,
castShadow = true,
shadowMapSize = 64,
staticShadows = true,
staticShadowDistance = 0, -- use static shadows always
},
{ class = "Particle",
particleSystem = "lava_effects",
offset = vec(0, -0.4, 0),
},
{
class = "TileDamager",
attackPower = 3,
damageType = "fire",
repeatCount = math.huge,
repeatDelay = 1,
onInit = function(self)
if self.go.map:getElevation(self.go.x, self.go.y) < self.go.elevation then
spawn("under_lava_effects", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
end
end,
},
{ class = "Timer",
timerInterval = 1,
currentLevelOnly = true,
triggerOnStart = true,
onActivate = function(self)
for f = 0,3 do spawn("eruption", self.go.level, self.go.x, self.go.y, f, self.go.elevation) end
self.go:playSound("magma_explosion")
spawn("lava_volcano_eruption_ground", self.go.level, self.go.x, self.go.y, self.go.facing, self.go.elevation-1)
self:setTimerInterval(300*(0.1+0.9*math.random()))
end,
onInit = function(self)
self:setTimerInterval(300*math.random())
end,
},
{ class = "Sound",
sound = "fire_pit",
volume = 0.5,
},
},
placement = "floor",
editorIcon = 88,
}