From 80957d54709f74419c241ce7defc5e1b6081371b Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 20 Nov 2025 21:58:41 +0000 Subject: [PATCH] Fix another layered circle rendering bug --- shader/dualTwoD/ellipse.vert | 2 +- src/Dodge/Event/Test.hs | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/shader/dualTwoD/ellipse.vert b/shader/dualTwoD/ellipse.vert index 57be8e0c2..21ec496cb 100644 --- a/shader/dualTwoD/ellipse.vert +++ b/shader/dualTwoD/ellipse.vert @@ -23,7 +23,7 @@ void main() int i0 = n + (3 * ((gl_VertexID-n)/6) ); gColC = data[i0].colx; gColE = data[i0+1].colx; - int k = ks[gl_VertexID % 6]; + int k = ks[(gl_VertexID - n) % 6]; gBoundingBox = bs[k]; gPos = (k > 2.5 ? data[i0].posx + data[i0+2].posx - data[i0+1].posx diff --git a/src/Dodge/Event/Test.hs b/src/Dodge/Event/Test.hs index cf5386372..c18261ddf 100644 --- a/src/Dodge/Event/Test.hs +++ b/src/Dodge/Event/Test.hs @@ -2,6 +2,7 @@ module Dodge.Event.Test (testEvent) where --import Dodge.Creature.State +import Dodge.Flame import Data.Maybe import Dodge.Data.World import LensHelp @@ -10,19 +11,22 @@ import Linear testEvent :: World -> World testEvent w = fromMaybe w $ do cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy - let distR = 50 - t1 = (V2 1 (-1)) - t2 = (V2 1 1) - t3 = (V2 distR 0) - v3 = V3 t1 t2 t3 - distortionBulge = - RadialDistortion - cpos - (V2 distR 0) - (V2 0 distR) - v3 v3 v3 - 20 - return $ w & cWorld . lWorld . distortions .~ [distortionBulge - , distortionBulge & rdPos +~ 50 & rdTR . _1 +~ V2 (-1) 1 - , distortionBulge & rdPos +~ (-50) - ] + return $ w & makeFlame (cpos + 25) 1 +--testEvent w = fromMaybe w $ do +-- cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos . _xy +-- let distR = 50 +-- t1 = (V2 1 (-1)) +-- t2 = (V2 1 1) +-- t3 = (V2 distR 0) +-- v3 = V3 t1 t2 t3 +-- distortionBulge = +-- RadialDistortion +-- cpos +-- (V2 distR 0) +-- (V2 0 distR) +-- v3 v3 v3 +-- 20 +-- return $ w & cWorld . lWorld . distortions .~ [distortionBulge +-- , distortionBulge & rdPos +~ 50 & rdTR . _1 +~ V2 (-1) 1 +-- , distortionBulge & rdPos +~ (-50) +-- ]