Page 2 of 3

Re: Useful particle effects!

Posted: Sat Oct 27, 2012 5:48 am
by HaunterV
J. Trudel wrote:Here is one very usefull for when you want to spawn a cave_in and hide it a bit : (sorry I don,t have an image yet)

material
SpoilerShow
defineParticleSystem{
name = "dust",
emitters = {


-- dust
{
emissionRate = 55,
emissionTime = 5,
maxParticles = 100,
boxMin = {-2, 0.1, -2},
boxMax = { 2, 1.4, 2},
sprayAngle = {0,45},
velocity = {0,0},
texture = "assets/textures/particles/fog.tga",
lifetime = {10,20},
color0 = {0.25, 0.2, 0.13},
opacity = 0.6,
fadeIn = 0.5,
fadeOut = 7,
size = {1, 5},
gravity = {0,-0.1,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Translucent",
objectSpace = false,
},
{
emissionRate = 45,
emissionTime = 10,
maxParticles = 100,
boxMin = {-2, 0,1,-2},
boxMax = { 2, 3, 2},
sprayAngle = {30,30},
velocity = {0,0},
texture = "assets/textures/particles/fog.tga",
lifetime = {10,20},
color0 = {0.25, 0.2, 0.13},
opacity = 0.6,
fadeIn = 0.3,
fadeOut = 2,
size = {0.1, 0.2},
gravity = {0,-0.75,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Translucent",
}
}
}
object
SpoilerShow
defineObject{
name = "dust_emitter",
class = "LightSource",
lightPosition = vec(1.2, 0.2, 0),
lightRange = 6,
lightColor = vec(1, 1, 1),
brightness = 0,
castShadow = true,
particleSystem = "dust",
placement = "floor",
editorIcon = 88,
}

so I am using that with my stone ogre statue becomes a living stone ogre and i gotta say it's friggn PERFECT

Re: Useful particle effects!

Posted: Sat Oct 27, 2012 8:28 am
by J. Trudel
HaunterV wrote:
J. Trudel wrote:Here is one very usefull for when you want to spawn a cave_in and hide it a bit : (sorry I don,t have an image yet)

material
SpoilerShow
defineParticleSystem{
name = "dust",
emitters = {


-- dust
{
emissionRate = 55,
emissionTime = 5,
maxParticles = 100,
boxMin = {-2, 0.1, -2},
boxMax = { 2, 1.4, 2},
sprayAngle = {0,45},
velocity = {0,0},
texture = "assets/textures/particles/fog.tga",
lifetime = {10,20},
color0 = {0.25, 0.2, 0.13},
opacity = 0.6,
fadeIn = 0.5,
fadeOut = 7,
size = {1, 5},
gravity = {0,-0.1,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Translucent",
objectSpace = false,
},
{
emissionRate = 45,
emissionTime = 10,
maxParticles = 100,
boxMin = {-2, 0,1,-2},
boxMax = { 2, 3, 2},
sprayAngle = {30,30},
velocity = {0,0},
texture = "assets/textures/particles/fog.tga",
lifetime = {10,20},
color0 = {0.25, 0.2, 0.13},
opacity = 0.6,
fadeIn = 0.3,
fadeOut = 2,
size = {0.1, 0.2},
gravity = {0,-0.75,0},
airResistance = 0.1,
rotationSpeed = 0.3,
blendMode = "Translucent",
}
}
}
object
SpoilerShow
defineObject{
name = "dust_emitter",
class = "LightSource",
lightPosition = vec(1.2, 0.2, 0),
lightRange = 6,
lightColor = vec(1, 1, 1),
brightness = 0,
castShadow = true,
particleSystem = "dust",
placement = "floor",
editorIcon = 88,
}

so I am using that with my stone ogre statue becomes a living stone ogre and i gotta say it's friggn PERFECT
I am glad someone actually used it :) I am trying to see what can be done with this particle system apparently it's a lot flexible yet a bit hard to understand... at least for me.

Re: Useful particle effects!

Posted: Sat Oct 27, 2012 9:11 am
by J. Trudel
Fire ! It fit in a square.

Material
SpoilerShow
defineParticleSystem{
name = "fire",
emitters = {
-- smoke
{
emissionRate = 60,
emissionTime = 0,
maxParticles = 500,
boxMin = {-3, 0.1, -1.5},
boxMax = {0, 2, 1.5},
sprayAngle = {0,30},
velocity = {0.1,0.5},
texture = "assets/textures/particles/smoke_01.tga",
lifetime = {1,1.75},
color0 = {0.15, 0.15, 0.15},
opacity = 0.6,
fadeIn = 0.5,
fadeOut = 0.5,
size = {1, 1.5},
gravity = {0,0,0},
airResistance = 0.1,
rotationSpeed = 0.6,
blendMode = "Translucent",
},

-- flames
{
emissionRate = 600,
emissionTime = 0,
maxParticles = 3000,
boxMin = {-3, -.2, -1.5},
boxMax = {0, 0, 1.5},
sprayAngle = {0,10},
velocity = {0.2, 1},
texture = "assets/textures/particles/torch_flame.tga",
frameRate = 35,
frameSize = 64,
frameCount = 16,
lifetime = {0.25, 0.85},
colorAnimation = true,
color0 = {2, 2, 2},
color1 = {1.0, 1.0, 1.0},
color2 = {1.0, 0.5, 0.25},
color3 = {1.0, 0.3, 0.1},
opacity = 1,
fadeIn = 0.15,
fadeOut = 0.3,
size = {0.15, 1},
gravity = {0,-0.1,0},
airResistance = 1.0,
rotationSpeed = 0.6,
blendMode = "Additive",
depthBias = -0.002,
},

}
}

Objet
SpoilerShow
defineObject{
name = "fire_emitter",
class = "LightSource",
lightPosition = vec(1.2, 0.2, 0),
lightRange = 6,
lightColor = vec(1, 1, 1),
brightness = 0,
castShadow = true,
particleSystem = "fire",
placement = "floor",
editorIcon = 88,
}

Re: Useful particle effects!

Posted: Sat Oct 27, 2012 2:24 pm
by Neikun
You should add brightness so it produces light as well.
Like this: (Also changes the light to a more orangey one.

Code: Select all

defineObject{
name = "fire_emitter",
class = "LightSource",
lightPosition = vec(1.2, 0.2, 0),
lightRange = 6,
lightColor = vec(2.8, 1.4, 1),
brightness = 20,
castShadow = true,
particleSystem = "fire",
placement = "floor",
editorIcon = 88,
}
It's also missing sound.
...Not sure how to handle that one.
Also it should probably be noted that you shouldn't place several of these effects near one another. They have quite the performance draw.
Hell, even having too many lamps on a level causes lag.

Re: Useful particle effects!

Posted: Sat Oct 27, 2012 4:20 pm
by HaunterV
Neikun wrote:You should add brightness so it produces light as well.
Like this: (Also changes the light to a more orangey one.

Code: Select all

defineObject{
name = "fire_emitter",
class = "LightSource",
lightPosition = vec(1.2, 0.2, 0),
lightRange = 6,
lightColor = vec(2.8, 1.4, 1),
brightness = 20,
castShadow = true,
particleSystem = "fire",
placement = "floor",
editorIcon = 88,
}
It's also missing sound.
...Not sure how to handle that one.
Also it should probably be noted that you shouldn't place several of these effects near one another. They have quite the performance draw.
Hell, even having too many lamps on a level causes lag.
I would say 3-5 torch burning effects that start at offset intervals.

Re: Useful particle effects!

Posted: Wed Mar 20, 2013 3:40 am
by remilafo
Hello guys..

First post here..

Im playing the particle system but it got too big... it's bleeding into other rooms..

In my Materials.lua or whatever.. where do i define the size of the particle effect?

in a 2D x, y co-ordinate system?

Remilafo

Re: Useful particle effects!

Posted: Wed Mar 20, 2013 4:05 am
by Diarmuid
It's boxMin and boxMan parameters, they are in grimrock units (meters). 1 tile is 3 meters wide/tall. Order of parameters is: width, height, depth. So a particle system with boxMin (-1.5, 0, -1.5) and boxMax (1.5, 3, 1.5) will be exactly a cube of one square wide and tall, from the center of the tile on the floor.

Re: Useful particle effects!

Posted: Wed Mar 20, 2013 2:51 pm
by remilafo
Diarmuid wrote:It's boxMin and boxMan parameters, they are in grimrock units (meters). 1 tile is 3 meters wide/tall. Order of parameters is: width, height, depth. So a particle system with boxMin (-1.5, 0, -1.5) and boxMax (1.5, 3, 1.5) will be exactly a cube of one square wide and tall, from the center of the tile on the floor.
Ahh i see... thanks.. this makes sense... the whole min and max thing confused me.

lol.. my min and max are like +/-12 values..

so... just to summarize..checking my understanding..

boxmin (-4.5, 0, -4.5) and boxMax (4.5, 3, 4.5) = 3 x 3 Grid with a height of 1.
boxmin (-7.5, 0, -7.5) and boxMax (7.5, 3, 7.5) = 5 x 5 grid...
boxmin (-1.5, 0, -4.5) and boxMax (1.5, 3, 4.5) = 1 x 3 vertical grid..

yeah?

Re: Useful particle effects!

Posted: Wed Mar 20, 2013 4:47 pm
by Diarmuid
Exactly.

Re: Useful particle effects!

Posted: Tue Oct 22, 2013 2:30 am
by Gradunk
To start off, here's the fog particle effect I stole from Rotten Place (...speaking of effort...) and then edited to be the thick thing it is right now:

materials.lua
Wolfrug you say this but does that mean i post that piece of script IN the materials thing? cause i can't open it so i'm not sure what to do.