본문으로 건너뛰기
CHOI HONGSU
1 min read

Skill-specific breakable object

A hit-feedback shader for AOs that are only destroyable by a specific skill, so the player can still recognize them as 'destructible' when struck with a non-destroying skill.

A hit-feedback shader for AOs that are only destroyable by a specific skill, so the player can still recognize them as 'destructible' when struck with a non-destroying skill.

Problem

Certain AOs in-game can only be destroyed by a specific skill. Attacking with a non-destroying skill still produces hit feedback, but it's hard for the player to tell whether 'the attack was blocked' or whether 'this object is destructible at all.'

Design ask: even when struck with a non-destroying skill, give visual feedback that the object is a "destructible target" + staged damage representation as hits accumulate

Constraints:

  • Minimize extra texture assets — letting textures grow proportionally to the hit-stage count is bad for both art cost and memory
  • SRP Batcher compatibility required — cbuffer layout aligned with sibling shaders (BG_Lit_AO, etc.)
  • Support GPU Indirect Instancing (_CUSTOM_INDIRECT path)

Approach

노이즈 텍스처 블렌딩

Chosen

Pros

  • Express unlimited stages with one noise texture — maximum memory efficiency

Cons

  • Appearance depends on the noise pattern — artists must choose the noise

텍스처 어레이 다중 슬라이스

Pros

  • Stages can have completely different looks

Cons

  • Stage count × 1 texture each → assets / memory grow proportionally

Why 노이즈 텍스처 블렌딩: Chosen: noise texture blending + a 2-slice array only for the first hit Reason: a single extra texture can express stages. Separated the appearance switch around the first hit (Texture Array 0→1) from the subsequent cumulative-hit stages (noise blend extension), and combined both methods by role.

Architecture

Three shader parameters each play an independent role:

ParameterVariationRole
_ArrayIndex0 → 1 instantlyOn first hit, texture swap — clean look → initial damage look
_NoiseBlend0 → 1 stepwise lerpNoise-threshold dissolve — cracks gradually spread
_Hit0 → 1 → 0 tweenFrame-of-hit precoloring flash

Noise dissolve math:

  • _NoiseBlend = 0: only the bright areas of the noise become TintColor → faint crack hints
  • _NoiseBlend = 1: full TintColor → fully damaged look
  • Fixed edge width 0.05 keeps boundaries sharp

Implementation

  1. 01

    1. Texture2DArray 2-slice design

    BG_Lit_AO expresses stages with an N-slice array, but SkillAO intentionally uses only 2 slices (0 and 1).

    • Slice 0: initial state (pre-destruction)
    • Slice 1: post-first-hit state (cracked look)

    On the first hit, _ArrayIndex flips 0→1 instantly; thereafter, _NoiseBlend drives the staging. Textures are fixed at 2, and the number of hit stages can be expanded indefinitely via noise.

    2. Role separation: noise blending vs texture array

    Question from Seonguk: "Is the Noise Texture Blend a blend driven by the texture array change?"

    → Independent feature. The problem of texture-array stages growing proportionally to texture count is replaced by a single noise texture.

    3. Hit Flash — HIT_BLEND_OPTIONS

    Added an intensity-scale control (_HitIntensity) to BG_Lit_AO's Hit Color. Lets you tune visual overlap with shake / noise effects via an independent parameter, instead of being overpowering by default.

    4. SRP Batcher cbuffer alignment

    Keep the leading float4 order identical to sibling shaders (BG_Lit_AO etc.). SkillAO-specific variables (_NoiseBlend, _NoiseTex_ST, _HitIntensity) are placed later in the cbuffer to prevent common-register collisions.

Tradeoffs & Future Work

Tradeoffs

  • Depends on the noise pattern — each AO needs a suitable noise texture to achieve the intended look
  • _ArrayIndex assumes only 0 / 1 — AOs that need 3+ appearance transitions need separate work
특정 스킬 파괴 오브젝트 · Cookie Run: Oven Smash · Choi Hongsu · Hongsu