{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiend57hifilxfylwut3lrs2jm43dazeyhxikkvgs2zhp6qdcld7cu",
    "uri": "at://did:plc:dxjzgxe7cvirxkwfjr2tjspt/app.bsky.feed.post/3mfdfuu25eya2"
  },
  "path": "/t/cartoonedgefilter-makes-the-entire-background-black/49419#post_2",
  "publishedAt": "2026-02-20T14:29:47.000Z",
  "site": "https://hub.jmonkeyengine.org",
  "tags": [
    "github.com/jMonkeyEngine/jmonkeyengine",
    "jme3-effects/src/main/resources/Common/MatDefs/Post/CartoonEdge.frag",
    "`48ce41b8e`"
  ],
  "textContent": "This is because the cartoon edge shader does not preserve the alpha channel.\n\ngithub.com/jMonkeyEngine/jmonkeyengine\n\n#### jme3-effects/src/main/resources/Common/MatDefs/Post/CartoonEdge.frag\n\n`48ce41b8e`\n\n\n\n\n\n\n        47.     normalDelta = clamp((normalDelta - m_NormalThreshold) * m_NormalSensitivity, 0.0, 1.0);\n\n\n\n        48.     depthDelta  = clamp((depthDelta - m_DepthThreshold) * m_DepthSensitivity,    0.0, 1.0);\n\n\n\n        49.\n\n\n\n        50.     // Does this pixel lie on an edge?\n\n\n\n        51.     float edgeAmount = clamp(normalDelta + depthDelta, 0.0, 1.0) * m_EdgeIntensity;\n\n\n\n        52.\n\n\n\n        53.     // Apply the edge detection result to the main scene color.\n\n\n\n        54.     //color *= (1.0 - edgeAmount);\n\n\n\n        55.     color = mix (color,m_EdgeColor.rgb,edgeAmount);\n\n\n\n        56.\n\n\n\n        57.     gl_FragColor = vec4(color, 1.0);\n\n\n\n        58. }\n\n\n\n\n\n\nI think the best solution atm is to fork CartoonEdgeFilter to preserve alpha. Tbh I don’t know why it wouldn’t already do that.",
  "title": "CartoonEdgeFilter makes the entire background black"
}