sarbian

[1.2.2 & 1.3] SmokeScreen 2.7.3 - Extended FX plugin (Mar 11th)

501 posts in this topic

SmokeScreen is a plugin whereby artists can add improved engine effects. It is built on the effects of 0.23, and its ideas come mostly from Nothke.

Changelog

  • 2.7.4 Fix an other performance problem
  • 2.7.2 Fix a performance problem with 2.7.1
  • 2.7.1 Fix 2 bugs related to the Shuriken system. Engine should now init properly and colors/alpha should be more consistent with the old system
  • 2.7.0 Add new effects type that wrap old particles system with the "new" Shuriken system. Post with details
  • 2.6.21 Fix jumping ships
  • 2.6.20 Fix the Layer problem (reentry fx on particles)
  • 2.6.19 Fix the ToolbarWrapper exception.
  • 2.6.18 Build for 1.2
  • 2.6.17 Fix an NRE spam
  • 2.6.16 Build for KSP 1.1.3
  • 2.6.15 Build for KSP 1.1
  • 2.6.13 Fix smoke running away from vehicle when Krakensbane activates by @ferram4
  • 2.6.12 Fix the NRE spam when adding a digit in the live editor
  • 2.6.11 Open the UI with Mod+P
  • 2.6.10 is a rebuild for 1.0.5 since some things were not working properly (???)
  • 2.6.9 Include Felger patch to add 3 parameters
    Global SmokeScreen Parameter:
    atmDensityExp - SmokeScreen.cfg variable, adjusts input atmospheric pressure by an exponent, to give similar plume scaling between RSS and Stock.
    ModelMultiParticlePersistFX Parameters:
    vRandPosOffset - Random positive position offset to spread fast particles out. Additive.
    vPosOffset - nonrandom positive ffset to adjust starting particle position. Additive.
  • 2.6.8 Improve performance
  • 2.6.7 an other bug fix
  • 2.6.6 bug fix
  • 2.6.5 add randConeEmit, xyForce and zForce curves
  • 2.6.4 New sizeClamp Curve that adds itself to the sizeClamp value
  • 2.6.3 Remove lengthScale & velocityScale curves (a Unity limitation made them not that usefull).
    Rescale effect when used with the ProceduralSRB of Procedural Parts
    new initalVelocityOffsetMaxRadius curve that adds its value to the randomInitalVelocityOffsetMaxRadius value.
  • 2.6.2 Add lengthScale & velocityScale curves. Some minor fix like using the game mach value (so mach will scale with the body atmo now)
  • 2.6.1 Fix the singleEmitTimer and add workaround for the stock effect init problem
  • 2.6.0 Quick fix for 1.0
  • 2.5.3 rebuild for 0.90
  • 2.5.2 renamed KM modules to avoid conflict with KM_lib. KM_PostLaunchEffect=>KM_PostLaunchEffect_SmkS and KM_PreLaunchEffect=>KM_PreLaunchEffect_SmkS
  • 2.5.1 includes module for ColdRockets
  • 2.5.0 is a recompile for KSP 0.25
  • 2.4.5 fix the disappearing ship bug that some user had.
  • 2.0 is out. Read this post for new features

 

Features

 

  • Enables resizing particle with distance and current angle between emitter and camera; e.g., a lens flare shown only when you look into the engine bell.
  • Enables changing the particle renderMode (http://docs.unity3d.com/Documentatio...enderMode.html)
  • Enables rescaling the emitter in the .cfg, permitting resizing of both model and effect.
  • Adds a "grow" variable whereby particles can grow with time
  • Adds a curve for emission, energy, speed, grow, size and emitters scale & offset with variation of atmo density and vessel Mach speed.
  • Particles collide with terrain.
  • Exhaust persists even when the engine is destroyed.
  • Compatible with the stock MODEL_MULTI_PARTICLE. Basic config uses the same args
  • Does not call the kraken when you change scene (stock does that on Flight => Spaceport on certain condition )
  • Limits number of active particle to twenty-thousand (soon configurable) and usually stays well-below

 

Future

 

  • Ship-centric emitters
  • Surface effects; e.g., dust, water.

 

I know the rules, not pict not click but you'll have to wait for Nothke to publish his engine config for the picts :)

Download : SmokeScreen-2.7.4.0.zip

License: BSD 2-Clause License

You are free to package the DLL with your mods as long as it uses the directory structure of my zip. And you would be kind to link to this thread so users can get a newer version when I release one.

Source : https://github.com/sarbian/SmokeScreen/

btn_donate_SM.gif

Edit : read eggrobin post for info on the last version feature

http://forum.kerbalspaceprogram.com/threads/71630-0-23-SmokeScreen-Extended-FX-plugin?p=1037130&viewfull=1#post1037130

So how does it works ? First you need to define an effect. Look into the "HotRockets!" thread for a working example with stock KSP.

You just have to change the MODEL_MULTI_PARTICLE into a MODEL_MULTI_PARTICLE_PERSIST

Here is a minimal config with only the required info

 

name = flamethrust

modelName = MP_Nazari/FX/flamestandard

transformName = thrustTransform

 

Here is the same config with all the default value shown :

 

 


modelName = MP_Nazari/FX/flamestandard
transformName = thrustTransform
shaderFileName =
renderMode = Billboard
collide = False
collideRatio = 0
localRotation = 0,0,0
localPosition = 0,0,0
offsetDirection = 0,0,1
fixedScale = 1
sizeClamp = 50
initialDensity = 0.6
physical = False
stickiness = 0.9
dragCoefficient = 0.1
timeModulo = 10
singleEmitTimer = 0
randomInitalVelocityOffsetMaxRadius = 0
angle = 1
distance = 1
emission
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
energy
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
speed
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
grow
{
power = 0
density = 0
mach = 0
parttemp = 0
externaltemp = 0
time = 0
}
scale
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
size
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
offset
{
power = 0
density = 0
mach = 0
parttemp = 0
externaltemp = 0
time = 0
}
force
{
power = 0
density = 0
mach = 0
parttemp = 0
externaltemp = 0
time = 0
}
logGrow
{
power = 0
density = 0
mach = 0
parttemp = 0
externaltemp = 0
time = 0
}
linGrow
{
power = 0
density = 0
mach = 0
parttemp = 0
externaltemp = 0
time = 0
}
logGrowScale
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
lengthScale
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
velocityScale
{
power = 1
density = 1
mach = 1
parttemp = 1
externaltemp = 1
time = 1
}
 

 

 

So now let's explain all those.

First we have 2 kind of config parameters :

- fixed parameter : all the xxx = yyy from modelName to angle

- curve : the entries with a subsection like emission or energy

The Fixed Parameters

modelName : point to the model of your effect. it's the same as the stock FX so you'll have to find stock tutorial on how to build those in unity.

transformName : part transform where your effect is attached

shaderFileName : point to a compiled shader text file to replace the default shader of your model. Not testes all that much

renderMode : set the particule renderMode, one of Billboard/HorizontalBillboard/SortedBillboard/Stretch/VerticalBillboard. See unity doc http://docs.unity3d.com/ScriptReference/ParticleRenderMode.html

localRotation : rotation of the effect. For when you did not align correctly in unity or want to point an other way

localPosition : move the effect away from the transform its attached to.

offsetDirection : direction of movement when offset is used, see offset curve.

fixedScale : fixed scale of the effect. For when you want to rescale to effect or the part

sizeClamp : maximum size of the particle.

collide : does the particle collide with stuff. False / True

collideRatio : change how the particle collide. Test in game to see the effect. Set to a value between 0 and 1

stickiness : how is the particle slowed on collision

physical : simulate the buoyancy of the particle/gas

initialDensity : density of the particle/gas at its starting size

dragCoefficient : atmo drag on the particle/gas

timeModulo : used with the time input (see bellow with the curve)

singleEmitTimer : when different than 0 change the behaviour of single emit event ( like flameout ) and replace them with an emission of x seconds.

randomInitalVelocityOffsetMaxRadius : let me copy Egg comment on the value

The initial velocity of the particles will be offset by a random amount lying in a disk perpendicular to the mean initial velocity whose radius is randomOffsetMaxRadius. This is similar to Unity's 'Random Velocity' Setting, except it will sample the offset from a (normal) disk rather than from a cube. Units (SI): m/s.

The Simple Curves

angle and distance distance are curve with only 1 input. They are used to resize particle with the camera distance and angle with the transform. They were added for flares effects. Since they are curve you need to add the line more than once to set them up.

For exemple here is a config that show the particles if the angle of the camera with the transform is lower than 45° :

 

 
angle = 0.0 1.0 // at 0° do not resize
angle = 45.0 1.0  // at 45° stil don't resize
angle = 50.0 0.0 // from 45° to 50° and beyond resize to 0. ( with 47.5° being half size)

 

The Multiple Input Curves

Those change different parameter of the effect in relation to multiple input curve. Those inputs curves are :

- power : the power sent to the effect. 0 to 1. For engines it's related to the throttle (set or current, it change with the engine config)

- density : atmo density.

- mach : current speed in mach. For now mach speed is calculated for AIR.

- parttemp : the part temperature

- externaltemp : the external temperature

- time : time in second modulo "timeModulo". So you get a repeating sequence between 0 and timeModulo.

Curve are divided in additive en multiplicative curve. The additive add the result of the inputs and the multiplicative multiply them.

emission : multiplicative. Change the number of particle emited per second

 

emission // Modulate emission from mach and density curve. You can add other section for size, energy, speed, grow, offset and scale

{

mach = 0.0 0.0

mach = 0.8 0.0 // don't display until mach .8

mach = 1.0 3.0

density = 1.0 0.0

density = 0.4 0.0 // don't display over .4 atmo

density = 0.3 1.0

density = 0.002 1.0

density = 0.001 0.0 // and stop under .001

}

 

energy : multiplicative. Change the energy (life in s) of each particle

speed : multiplicative. Change the particle speed

grow : additive. Change how the particle grow with time with a exponential functions. 1 is 100% per second

 

SS_grow.png

 

scale : multiplicative. Rescale the emitter

size : multiplicative. Rescale the particles

offset : additive. Move the emitter away from the transform in "offsetDirection"

force : additive. Change the power of the force applied to the particles each frame

logGrow : additive. Change how the particle grow with time with a logarithmic functions

 

SS_log.png

 

linGrow : additive. Change how the particle grow with time linearly

 

SS_lin.png

 

logGrowScale : multiplicative. Change the log function base

lengthScale : multiplicative. How much are the particles stretched in their direction of motion.

velocityScale : multiplicative. How much are the particles strectched depending on "how fast they move". Use this to make particles get longer as their speed increases.

randConeEmit: additive default value 0 (no cone emission), similar to

randomInitalVelocityOffsetMaxRadius, but a little less random effect

appearance in-game. Forces a mirrored emission to ensure symmetric

plume appearance.

xyForce: multiplicative default value 1, multiplicatively damps or grows horizontal

(perpendicular to exhaust velocity) speed.

zForce: multiplicative default value 1 multiplicatively damps or grows vertical

(parallel to exhaust velocity) speed.

Edited by sarbian
22 people like this

Share this post


Link to post
Share on other sites

So it is finally here :D well nothke still needs to release his config but I hope that doesn't take all to much longer

Share this post


Link to post
Share on other sites

Looks useful :)

...you'll have to wait for Nothke to publish his engine config for the picts :)...

So Soonâ„¢?

Share this post


Link to post
Share on other sites

Thanks Sarbian for the last month! Here comes my counterpart of the project

Share this post


Link to post
Share on other sites

Two questions:

Can the color of a flame be altered via plugin, or would it have to be through texture/modeling? Ideally what I want to do is have a set of colors representing various substances and temperatures to interpolate between.

Second, can particles be made to spawn at an offset from the origin in order to create a cylindrical (or rectangular) sheet?

Share this post


Link to post
Share on other sites

Wow, sounds really cool and useful! :)

Share this post


Link to post
Share on other sites
Two questions:

Can the color of a flame be altered via plugin, or would it have to be through texture/modeling? Ideally what I want to do is have a set of colors representing various substances and temperatures to interpolate between.

Second, can particles be made to spawn at an offset from the origin in order to create a cylindrical (or rectangular) sheet?

1. Color, not yet.

2. You can create a spawn shape like a circle, ellipse, box, plane, point and a few more shapes from the particle exporter options. You can create offset in two ways, one is to create an offset by moving the system in Unity, then puting it under a parent gameobject, and another way is to add a "localOffset = 0,0,0" line, or "offset = 0.0 0.0" if you need to make it moveable, although it works in just one dimension (Y).

Share this post


Link to post
Share on other sites

Spawn shape is more what I'm after than offsetting the effect as a whole, in which case what I'd need would be a hoop I guess. (Equivalent to offsetting each individual particle a fixed distance at a random angle in the plane.)

Share this post


Link to post
Share on other sites

Nothke found a bug related to part unloading ( think SRB falling down ). I uploaded a new version that should fix that but their trail will vanish until I find a proper way to handle this case.

Share this post


Link to post
Share on other sites

I am really curious how this looks in action :)

Share this post


Link to post
Share on other sites
I am really curious how this looks in action :)

Like this:

JLyMdTkl.png

or this..

CHqJHLnl.png

or this..

vmoUMltl.png

Share this post


Link to post
Share on other sites
Mother of God....does this mod add that to all engines or do I have to edit them myself?

SmokeScreen doesn't add anything visually. It's a plugin to help creation of new particle systems including a lot of fixes from the stock exporter. What's in the screens is a particle mod that I am developing right now.

Share this post


Link to post
Share on other sites

Macross Missile madness! This looks amazing guys. (+sub'd)

Share this post


Link to post
Share on other sites

How much does this stuff hurt performance? Does it put any more load onto the CPU, or is it primarily GPU intensive?

Share this post


Link to post
Share on other sites

Man, this is locking gorgeous, but i will wait until it have an proper set of config to all rockets .

Great Job! ;)

Hey Nothke, will you post or set of config files for us?

Edited by Climberfx

Share this post


Link to post
Share on other sites

Gonna have HotRockets, CoolRockets and SmokeScreen together for glorious all seasons particle system update for all types

Probably followed by KSP crying in the corner

Share this post


Link to post
Share on other sites

I hope this will work with RealFuels, I haven't used HotRockets because of the RealFuels incompatibility.

Share this post


Link to post
Share on other sites

Yeah, I hope to fix that one this weekend. I've been on dev hiatus for a month, really sorry folks...

sarbian, nothke: that....that is amazing stuff right there. Congrats for awesomeness. :)

Share this post


Link to post
Share on other sites

sarbian: Great plugin! One remark however:

I'm not sure whether it's too late to change the identifiers (there shouldn't be too many compatibility problems right now), but I think 'persistant' should be replaced by 'persistent' (unless you intended to name the classes in French). I'll report it as a bug on GitHub.

nothke: These screenshots look great!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now