Advertisement
CloneTrooper1019

Fun with Particles.

Jul 22nd, 2014
1,616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. Entropy build
  2.  
  3. IMPORTANT: please, do not upload any games to roblox.com using this build. While this build is bound to gametest1, new features you can find here are not implemented in ROBLOX Player, so you won't be able to see anything in-game. WHEN YOU OPEN AN EXISTING PLACE TO WORK/EXPERIMENT ON AND WISH TO SAVE, BE SURE TO SAVE IT UNDER A DIFFERENT NAME, BECAUSE OVERWRITING WILL LIKELY BREAK SOMETHING.
  4. Also, this build is not officially 'supported' by ROBLOX, so assume it's buggy as hell.
  5.  
  6.  
  7.  
  8. This is a 'development build' of ROBLOX Studio with some experimental features in it. The most important one - is the brand old new configurable particle system. We've had this technology for a while now (since we moved to our brand new 3D Engine), but were somewhat reluctant to actually share it up until now.
  9.  
  10. Here at ROBLOX HQ, we're always trying to balance our platform between simplicity and flexibility. Up to this point, particles have been rather simple. What we're trying to figure out now, is do we need more particle system flexibility? What exactly would that open up for developers to create? By showing us what you can do with them, it helps inform our debate. What we'd really like to see is new particle emitters used in existing places to really enhance the place: things developers can't do right now on production.
  11.  
  12. So here's the thing - it's called 'SuperSpray' (homage to Super Spray in 3ds max). You just put it under a part, as you would a Fire or Smoke. And then the good stuff happens; be sure to check out the included _places/particles3.rbxl for some cool demonstration.
  13.  
  14.  
  15. http://i.imgur.com/tjFDXu9.png
  16.  
  17. Particle system 101
  18.  
  19. Emission
  20.  
  21. The particle system emits particles. Emission rate is in particles/second (fractional numbers work). Each particle spawns somewhere within the given box (EmitterSize:x,y,z). They live for a preset amount of time (Life:min,max), then disappear. EmitterShape is not yet implemented.
  22.  
  23. Appearance
  24.  
  25. Particle appearance is controlled via two primary attributes: particle color and particle image.
  26.  
  27. MainTexture sets the image, while ColorStripTexture and AlphaStripTexture control the color/alpha in a rather peculiar fashion: each horizontal line determines each particle's color/alpha over its lifetime. Baseline tells which line in the texture will be used, if it's set to -1, each particle will pick a random line at spawn.
  28.  
  29. http://i.imgur.com/reBEzkE.png
  30. Example color strip (included)
  31.  
  32. http://i.imgur.com/scfJRw2.png
  33. Example alpha strip (included)
  34.  
  35. This allows you to have particles change color over time in any way you like, while texture height provides room for some randomness.
  36.  
  37. If you open particles3.rbxl (included) and set baseline to 0, you'll see the particles become more monotonous because they all would use the same color line.
  38.  
  39. Particle texture and color are mixed together and then with the background using a preset shader and blending combination called ShaderType.
  40. Sounds obscure, but you are encouraged to experiment.
  41.  
  42. // shader and framebuffer blending mode (source-factor rop dest-factor)
  43.  
  44. Normal, modulate and (ALPHA+INVALPHA)
  45. Additive, additive (alpha multiplied) and (ONE+ONE)
  46. Multiplicative, lerp(1,tex,alphaStrip) and (SRC*DEST)
  47. PremulAlpha, modulate and (ONE+INVALPHA)
  48. AdditiveSoft, additive and (ALPHA+ONE)
  49.  
  50. Those who want more information can take a look into shaders/source/particle.hlsl for the shaders. If you can come up with a different and useful shader, be sure to post the shader code in this topic. (You can hijack one of the existing functions for development and testing.)
  51.  
  52. Textures may be put locally in content/... and referred to with "rbxasset://..." prefix, or you can upload them as decals on the website and use the http link as you would for a decal. We provide some demo textures for convenience to get you started.
  53.  
  54. NOTE: color strip and alpha strip textures must have the same dimensions.
  55.  
  56. Motion
  57.  
  58. Most parameters here are Vector2's that define uniform random scalar values with min/max (.x defines the minimum and .y the maximum) that each particle randomly rolls for on spawn.
  59.  
  60. Speed:min,max - initial speed of each particle (studs/s)
  61. SizeX:min,max - horizontal size (studs)
  62. SizeY:min,max - vertical size (studs)
  63. Growth:x,y - how fast particles change their size (studs/s), negative means shrinking
  64. Rotation:min,max - initial particle orientation (degrees)
  65. Spin:min,max - particle spin around longitudal axis (degrees/s)
  66. LocalForce and GlobalForce - particle acceleration in part-local and world-global reference frames respectively (studs/s^2).
  67. Dampening - controls environment impact on the particles (e.g. air friction) (unitless). The number tells what portion (relative) of its velocity every particle loses every frame. (So the higher the speed, the higher the velocity loss is in absolute numbers.) Note that if you have nonzero accelerations, with dampening enabled, they will converge to some 'equilibrium velocity', which is fun.
  68.  
  69.  
  70. General considerations and notes
  71. Lots of particles can bring even the best system to its knees, because rendering lots of transparent quads imposes a strain on ROP units and framebuffer memory bandwidth of your graphics card.
  72.  
  73. All particle emitters have a hard system-wide cap of 16384 particles total on PC/Mac and 3500 total on mobile.
  74.  
  75. Emitters that produce more particles than can fit into the global cap are not rendered.
  76.  
  77. The order in which emitters are submitted for rendering is unspecified.
  78.  
  79. Emitters outside of the view are not updated.
  80.  
  81.  
  82. Known issues
  83. Some parameters may forget to fire onChanged events.
  84.  
  85. Bounding boxes are overexaggerated, due to dampening parameter not being taken into account.
  86.  
  87. There is a problem with texture reloading on the fly - i.e., we don't have one yet. You will have to reopen the place file to reload.
  88.  
  89. Stock particle systems have been deliberately disabled in this build.
  90.  
  91. Lighting/time-of-day is deliberately broken in this build, but you do have some experimental lighting controls under Lighting.
  92.  
  93. Character animations may be broken.
  94.  
  95. Some other experimental features may have snuck in. Have fun!
  96.  
  97. Grab it here! (Link not available for pastebin :P)
  98. You might also need VC2012 redist if it complains about msvcp110.dll. (Link not available for pastebin :P)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement