a nice cavern filled with lava
Posted: Wed Dec 31, 2014 5:51 pm
all is in the title:
1°)place a mine chasm on the floor
2°)then the fire_emitter over the chasm.
note: to save ressources you can turn off the "castShadow = true" to false.
fire_emitter:
the particle:
what it looks like:
1°)place a mine chasm on the floor
2°)then the fire_emitter over the chasm.
note: to save ressources you can turn off the "castShadow = true" to false.
fire_emitter:
SpoilerShow
Code: Select all
-- fire on floor
defineObject{
name = "fire_emitter",
components = {
{
class = "Model",
model = "assets/models/effects/wall_fire.fbx",
sortOffset = 1,
},
{
class = "Light",
offset = vec(0, 0.2, 0),
range = 6,
color = vec(2.8, 1.2, 0.7),
brightness = 2,
castShadow = true,
shadowMapSize = 64,
staticShadows = true,
staticShadowDistance = 0, -- use static shadows always
},
{
class = "Particle",
particleSystem = "dungeon_fire_pit_2",
offset = vec(0, 0, 0),
},
{
class = "Controller",
onActivate = function(self)
self.go.light:enable()
self.go.pointlight:enable()
self.go.particle:enable()
end,
onDeactivate = function(self)
self.go.light:disable()
self.go.pointlight:disable()
self.go.particle:disable()
end,
onToggle = function(self)
if self.go.light:isEnabled() then
self.go.light:disable()
self.go.pointlight:disable()
self.go.particle:disable()
else
self.go.light:enable()
self.go.pointlight:enable()
self.go.particle:enable()
end
end,
},
},
placement = "floor",
editorIcon = 88,
}
SpoilerShow
Code: Select all
defineParticleSystem{
name = "dungeon_fire_pit_2",
emitters = {
-- fog 1
{
emissionRate = 50,
emissionTime = 0,
maxParticles = 500,
boxMin = {-1.3, 0,-1.3},
boxMax = { 1.3, 0.5, 1.3},
sprayAngle = {0,360},
velocity = {0.1,0.2},
objectSpace = true,
texture = "assets/textures/particles/fog.tga",
lifetime = {3,3},
color0 = {1.25,0.4,0.2},
opacity = 0.5,
fadeIn = 2.2,
fadeOut = 2.2,
size = {0.75, 1.5},
gravity = {0,0.1,0},
airResistance = 0.5,
rotationSpeed = 0.3,
blendMode = "Additive",
},
-- fog 2
{
emissionRate = 50,
emissionTime = 0,
maxParticles = 500,
boxMin = {-1.3, 0,-1.3},
boxMax = { 1.3, 0.5, 1.3},
sprayAngle = {0,360},
velocity = {0.1,0.2},
objectSpace = true,
texture = "assets/textures/particles/fog.tga",
lifetime = {3,3},
color0 = {1.25,0.4,0.2},
opacity = 0.5,
fadeIn = 2.2,
fadeOut = 2.2,
size = {0.75, 1.5},
gravity = {0,0.1,0},
airResistance = 0.5,
rotationSpeed = -0.3,
blendMode = "Additive",
},
-- stars
{
emissionRate = 400,
emissionTime = 0,
maxParticles = 3000,
boxMin = {-1.3, 0.0,-1.3},
boxMax = { 1.3, 0.5, 1.3},
sprayAngle = {0,360},
velocity = {0,0},
objectSpace = true,
texture = "assets/textures/particles/firefly_dif.tga",
lifetime = {0.5,3},
color0 = {4, 0.4, 0.2},
opacity = 1,
fadeIn = 0.1,
fadeOut = 0.1,
size = {0.05, 0.1},
gravity = {0,0.5,0},
airResistance = 0.1,
rotationSpeed = 5,
blendMode = "Additive",
},
-- smoke
{
emissionRate = 5,
emissionTime = 0,
maxParticles = 50,
boxMin = {-1.3, 0, -1.3},
boxMax = { 1.3, 1.0, 1.3},
sprayAngle = {0,20},
velocity = {0.4, 0.8},
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,3},
color0 = {0.25, 0.20, 0.17},
opacity = 0.5,
fadeIn = 0.3,
fadeOut = 0.9,
size = {1.5, 2},
gravity = {0,0.3,0},
airResistance = 0.1,
rotationSpeed = 0.5,
blendMode = "Translucent",
},
}
}
SpoilerShow