Particular & DOF - eirisocherry/csgo-editing GitHub Wiki

Video tutorial:

Extract CSGO sprites (particle images)
  1. Download GCFScape (csgo assets extractor): https://gamebanana.com/tools/26
  2. Import ..\Counter-Strike Global Offensive\csgo\pak01_dir.vpk to GCFScape
  3. Extract materials\particle folder
  4. Install VTF Reader: https://gamebanana.com/tools/5537
  5. View <particle_name>.vtf files via VTF Reader
  6. Save particles you like as .tga
    Screenshot_96
    image

Split sprite sheets to image sequence
  1. Install Sprite-O-Matic (AE script that splits sprite sheets): https://aescripts.com/sprite-o-matic/
    Direct link: https://drive.google.com/file/d/1u77DEeKRT-obfFF7FNRRPKxp6NqiSx8d/view?usp=drive_link
  2. [Optional] Sprite sheet viewer: https://jangafx.com/software/gametextureviewer

Particular
>>> Custom sprites

Particle > Particle Type: [Textured Polygon] [Source] (Source because Effects and Masks will be used for z-depth generation later)
Particle > Texture > Layer: [Sprite Texture]

1. 'Sprite comp' must have 'Rasterize' disabled (every time you specify the texture, particular enables rasterize, but you must keep it disabled)  
2. Inside the 'sprite comp' all layers must be precomposed (must have default transform)  

Particle > Texture > Time Sampling: [<unique> or <particle_animation_start> - <particle_type>]

<unique>  
Current Time: particle is animated, its appearance depends on what sprite comp shows right now in the main composition, once sprite comp is over particle disappears  
Current Time - Freeze: particle is a static image, its appearance depends on what sprite comp shows right now in the main composition, once sprite comp is over particles stop being emitted  

<particle_animation_start>  
Start at Birth: particle animation will start from the beginning in the sprite comp  
Random: particle animation will start from a random frame in the sprite comp  
Split Clip: particle is a random clip in the sprite comp (`Numbers of Clips` splits the sprite comp into selected uniform pieces)  

<particle_type>  
Still frame: particle is a static image  
Play once: particle is animated, when animation reaches the end of a `sprite comp / clip` particle disappears  
Loop: particle is animated, when animation reaches the end of a `sprite comp / clip` it plays again from the beginning of the `sprite comp / clip`  
Stretch: particle is animated, animation length will be stretched to match the particle life span (`Subframe Sampling` if checked generates subframes to smooth the animation if it lacks of frames)  
Freeze: particle is a static image  

>>> Perfect mask with z-depth

To perfectly mask the particles: set z-buffer and its farthest point distance

The farthest depth point value (Z at Black or Z at White, depends on your depth):
CSGO (if you use my cfgs): 4096
CS2 (if you use my cfgs): not gonna work properly, because cs2 depth is logarithmic (particular wants linear depth)
COD4: 4080
EXR Depth: set the same value you set in EXtractoR
image


>>> Generate z-depth for particles
  1. Duplicate particles layer and rename it to <name> depth for convenience
  2. Particle > Particle Type: [Textured Polygon] [Effects & Masks]
    Apply white fill effect to the sprite comp, then add levels and adjust alpha channel so there is no semi-transparent pixels
  3. Particle > Blend Mode: [Lighten]
    Add black Solid Composite effect to the particular layer, so there is no transparency, only black and white depth
  4. Mask the particles with a game z-depth (view "Perfect mask with z-depth" category)
    Then set Far Vanish to the game z-depth farthest point
    Far Start Fade: 0
    Near Start Fade: 1
    Near Vanish: 0
    Near and Far curves: Linear
    image
    image

Congrats, particles depth is finished



Depth of Field

After Effects DOF Plugins (z-depth is required)

Frischluft (fl depth of field, best dof plugin): https://www.frischluft.com/order/index.php
DOF Pro (looks a bit better than fl dof, but super slow): https://richardrosenman.com/shop/dof-pro-ae/
Bokeh (the most beautiful, but z-depth mask is ugly): https://aescripts.com/crossphere-bokeh/

>>> FL Depth of Field
  1. Duplicate the depth and name it something like dof depth
  2. Add levels effect and normalize the depth, so it looks super contrast
  3. On the latest levels effect switch Clip To Output Black and Clip To Output White to On to clip all depth brightness values outside 0-1 range
    3.1. If near color on the z-depth is black, then add invert effect, because fl depth of field expects the depth with near white color, otherwise you will get ugly edges around blur

Before normalizing:
image
After normalizing:
image

  1. Make an adjustment layer, apply fl depth of field Set depth dof as depth layer input Switch [Source] to [Effects & Masks]
    Select a focal point with a cursor image

Once you've selected the focal point, never drag this white circle, otherwise your ae may crash
image


>>> Iris and Gamma


⚠️ **GitHub.com Fallback** ⚠️