From 7c62479f3093331b76dfbbe6b6fcb50bdd3652a1 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 6 Nov 2025 22:01:24 +0000 Subject: [PATCH] Tweak clouds --- shader/cloud/basic.frag | 3 +- src/Dodge/Render.hs | 9 ++++++ src/MatrixHelper.hs | 1 + src/Shader/Poke/Cloud.hs | 2 +- tags | 70 ++++++++++++++++++++-------------------- 5 files changed, 48 insertions(+), 37 deletions(-) diff --git a/shader/cloud/basic.frag b/shader/cloud/basic.frag index 6c3ad793e..d2987e038 100644 --- a/shader/cloud/basic.frag +++ b/shader/cloud/basic.frag @@ -11,5 +11,6 @@ void main() if (d > 1) {discard;} fCol = vec4(vCol.xyz,vCol.w*(1-d)); fPos = vec4(vPosID.xyz, vCol.w*(1-d)); - fNorm = vec4(vControls.xy, 0.1 ,fPos.w); // note arbitrary 0.1, might want to point downwards at the edges? + fNorm = vec4(-vControls.xy, -0.1 + 0.2 * d ,fPos.w); + //fNorm = vec4(-vControls.xy, -0.1 + d , fPos.w); } diff --git a/src/Dodge/Render.hs b/src/Dodge/Render.hs index 93713f373..64b898761 100644 --- a/src/Dodge/Render.hs +++ b/src/Dodge/Render.hs @@ -262,6 +262,14 @@ doDrawing' win pdata u = do glDepthFunc GL_ALWAYS glBindTextureUnit 0 (pdata ^. fboBloom . _2 . unTO) glDisable GL_BLEND + -- this all needs more tuning + more thought + -- a fade effect would be cool, so not to fully reset last frames bloom + -- buffers... +-- withArray [0, 0, 0, 0] $ +-- glClearNamedFramebufferfv (pdata ^. fboHalf1 . _1 . unFBO) GL_COLOR 0 +-- withArray [0, 0, 0, 0] $ +-- glClearNamedFramebufferfv (pdata ^. fboHalf2 . _1 . unFBO) GL_COLOR 0 +-- glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA drawShader (_bloomBlurShader pdata) 4 when (cfig ^. graphics_bloom) $ do replicateM_ 2 $ pingPongBetween @@ -377,6 +385,7 @@ doDrawing' win pdata u = do --Draw blurred bloom onto base buffer glEnable GL_BLEND glBlendFunc GL_SRC_ALPHA GL_ONE + --glBlendFunc GL_ONE GL_ONE glBindTextureUnit 0 (_unTO . snd $ _fboHalf1 pdata) drawShader (_fullscreenShader pdata) 4 glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA diff --git a/src/MatrixHelper.hs b/src/MatrixHelper.hs index 3d3a8bb04..9384ec920 100644 --- a/src/MatrixHelper.hs +++ b/src/MatrixHelper.hs @@ -54,6 +54,7 @@ lmt :: V4 (V4 a) -> V4 (V4 a) lmt = Linear.Matrix.transpose vToL :: V4 a -> [a] +{-# INLINE vToL #-} vToL (V4 a b c d) = [a, b, c, d] perMat :: Float -> V4 (V4 Float) diff --git a/src/Shader/Poke/Cloud.hs b/src/Shader/Poke/Cloud.hs index 5a30c89de..a8e92d32f 100644 --- a/src/Shader/Poke/Cloud.hs +++ b/src/Shader/Poke/Cloud.hs @@ -44,7 +44,7 @@ pokeCloudLikeVerx ptr (V3 cx cy cz, V4 r g b a) nv i (dx, dy) = UV.imapM_ (pokeCloudFloat ptr (nv + i)) $ UV.fromList [x, y, cz, 1, r, g, b, a, dx, dy, 0, 0] where - V2 x y = V2 cx cy - 20 *^ V2 dx dy + V2 x y = V2 cx cy + 20 *^ V2 dx dy clColor :: CloudType -> Color clColor = \case diff --git a/tags b/tags index 5cdaf26c7..130b5f4e3 100644 --- a/tags +++ b/tags @@ -2700,7 +2700,7 @@ brightX src/Color.hs 116;" f btSPic src/Dodge/Render/ShapePicture.hs 129;" f btText src/Dodge/Inventory/SelectionList.hs 237;" f bufferEBO src/Shader/Bind.hs 28;" f -bufferPerspectiveMatrixUBO src/Dodge/Render.hs 422;" f +bufferPerspectiveMatrixUBO src/Dodge/Render.hs 435;" f bufferPokedVBO src/Shader/Bind.hs 19;" f bufferShaderLayers src/Shader/Bind.hs 36;" f bulletBeltBracer src/Dodge/Item/Equipment.hs 67;" f @@ -2807,7 +2807,7 @@ clockCycle src/Dodge/Clock.hs 7;" f closeButtonToSelectionItem src/Dodge/Inventory/SelectionList.hs 223;" f closeItemToSelectionItem src/Dodge/Inventory/SelectionList.hs 208;" f closeItemToTextPictures src/Dodge/Inventory/SelectionList.hs 243;" f -closeObjectInfo src/Dodge/Render/HUD.hs 226;" f +closeObjectInfo src/Dodge/Render/HUD.hs 227;" f closestPointOnLine src/Geometry/Intersect.hs 272;" f closestPointOnLineParam src/Geometry/Intersect.hs 288;" f closestPointOnSeg src/Geometry/Intersect.hs 303;" f @@ -2845,7 +2845,7 @@ combinationsOf src/Multiset.hs 46;" f combinationsTrie src/Dodge/Combine.hs 43;" f combineAwareness src/Dodge/Creature/Perception.hs 109;" f combineFloors src/Dodge/Room/Procedural.hs 152;" f -combineInventoryExtra src/Dodge/Render/HUD.hs 337;" f +combineInventoryExtra src/Dodge/Render/HUD.hs 338;" f combineItemListYouX src/Dodge/Combine.hs 35;" f combineList src/Dodge/Combine.hs 21;" f combineRooms src/Dodge/Room/Procedural.hs 132;" f @@ -3243,7 +3243,7 @@ drawCircCollisionTest src/Dodge/Debug/Picture.hs 118;" f drawCliff src/Dodge/Render/ShapePicture.hs 55;" f drawCollisionTest src/Dodge/Debug/Picture.hs 103;" f drawCombFilter src/Dodge/Render/Picture.hs 269;" f -drawCombineInventory src/Dodge/Render/HUD.hs 182;" f +drawCombineInventory src/Dodge/Render/HUD.hs 183;" f drawConcurrentMessage src/Dodge/Render/Picture.hs 74;" f drawCoord src/Dodge/Debug/Picture.hs 395;" f drawCrInfo src/Dodge/Debug.hs 169;" f @@ -3261,12 +3261,12 @@ drawDrag src/Dodge/Render/Picture.hs 200;" f drawDragDrop src/Dodge/Render/Picture.hs 229;" f drawDragPickup src/Dodge/Render/Picture.hs 238;" f drawDragSelect src/Dodge/Render/Picture.hs 197;" f -drawDragSelected src/Dodge/Render/HUD.hs 136;" f -drawDragSelecting src/Dodge/Render/HUD.hs 153;" f +drawDragSelected src/Dodge/Render/HUD.hs 137;" f +drawDragSelecting src/Dodge/Render/HUD.hs 154;" f drawEmptySet src/Dodge/Render/Picture.hs 153;" f drawEnergyBall src/Dodge/EnergyBall/Draw.hs 7;" f drawEquipment src/Dodge/Creature/Picture.hs 127;" f -drawExamineInventory src/Dodge/Render/HUD.hs 198;" f +drawExamineInventory src/Dodge/Render/HUD.hs 199;" f drawExplosiveBall src/Dodge/EnergyBall/Draw.hs 15;" f drawFarWallDetect src/Dodge/Debug/Picture.hs 278;" f drawFlame src/Dodge/Flame/Draw.hs 8;" f @@ -3274,13 +3274,13 @@ drawFlamelet src/Dodge/EnergyBall/Draw.hs 37;" f drawForceField src/Dodge/Wall/Draw.hs 13;" f drawGapPlus src/Dodge/Render/Picture.hs 280;" f drawGib src/Dodge/Prop/Draw.hs 26;" f -drawHUD src/Dodge/Render/HUD.hs 51;" f +drawHUD src/Dodge/Render/HUD.hs 52;" f drawInputMenu src/Dodge/Render/MenuScreen.hs 19;" f drawInspectWall src/Dodge/Debug/Picture.hs 255;" f drawInspectWalls src/Dodge/Debug/Picture.hs 243;" f -drawInventory src/Dodge/Render/HUD.hs 58;" f -drawItemChildrenConnect src/Dodge/Render/HUD.hs 329;" f -drawItemConnections src/Dodge/Render/HUD.hs 319;" f +drawInventory src/Dodge/Render/HUD.hs 59;" f +drawItemChildrenConnect src/Dodge/Render/HUD.hs 330;" f +drawItemConnections src/Dodge/Render/HUD.hs 320;" f drawJumpDown src/Dodge/Render/Picture.hs 192;" f drawLabCrossCol src/Dodge/Render/Label.hs 8;" f drawLabelledList src/Dodge/Render/List.hs 212;" f @@ -3293,13 +3293,13 @@ drawListYgapScaleYoff src/Dodge/Render/List.hs 96;" f drawListYoff src/Dodge/Render/List.hs 93;" f drawMachine src/Dodge/Machine/Draw.hs 16;" f drawMapperAR src/Dodge/Targeting/Draw.hs 12;" f -drawMapperInventory src/Dodge/Render/HUD.hs 173;" f +drawMapperInventory src/Dodge/Render/HUD.hs 174;" f drawMenuClick src/Dodge/Render/Picture.hs 168;" f drawMenuCursor src/Dodge/Render/Picture.hs 180;" f drawMenuOrHUD src/Dodge/Render/Picture.hs 69;" f drawMenuScreen src/Dodge/Render/MenuScreen.hs 14;" f drawMouseCursor src/Dodge/Render/Picture.hs 85;" f -drawMouseOver src/Dodge/Render/HUD.hs 109;" f +drawMouseOver src/Dodge/Render/HUD.hs 110;" f drawMousePosition src/Dodge/Debug/Picture.hs 385;" f drawOptions src/Dodge/Render/MenuScreen.hs 22;" f drawPathBetween src/Dodge/Debug/Picture.hs 202;" f @@ -3311,11 +3311,11 @@ drawProjectile src/Dodge/Projectile/Draw.hs 13;" f drawProxSensor src/Dodge/Machine/Draw.hs 37;" f drawPulseBall src/Dodge/Render/ShapePicture.hs 63;" f drawQuitTerminal src/Dodge/Render/Picture.hs 147;" f -drawRBOptions src/Dodge/Render/HUD.hs 251;" f +drawRBOptions src/Dodge/Render/HUD.hs 252;" f drawRadarSweep src/Dodge/RadarSweep/Draw.hs 14;" f drawRemoteShell src/Dodge/Projectile/Draw.hs 38;" f drawReturn src/Dodge/Render/Picture.hs 156;" f -drawRootCursor src/Dodge/Render/HUD.hs 76;" f +drawRootCursor src/Dodge/Render/HUD.hs 77;" f drawSSCursor src/Dodge/SelectionSections/Draw.hs 35;" f drawSSMultiCursor src/Dodge/SelectionSections/Draw.hs 46;" f drawSelect src/Dodge/Render/Picture.hs 257;" f @@ -3329,11 +3329,11 @@ drawShell src/Dodge/Projectile/Draw.hs 22;" f drawShockwave src/Dodge/Shockwave/Draw.hs 6;" f drawSpark src/Dodge/Spark/Draw.hs 7;" f drawStaticBall src/Dodge/EnergyBall/Draw.hs 28;" f -drawSubInventory src/Dodge/Render/HUD.hs 163;" f +drawSubInventory src/Dodge/Render/HUD.hs 164;" f drawSwitch src/Dodge/Button/Draw.hs 16;" f drawSwitchWire src/Dodge/LevelGen/Switch.hs 24;" f drawTargetingAR src/Dodge/Targeting/Draw.hs 20;" f -drawTerminalDisplay src/Dodge/Render/HUD.hs 360;" f +drawTerminalDisplay src/Dodge/Render/HUD.hs 361;" f drawTeslaArc src/Dodge/Tesla/Draw.hs 9;" f drawText src/Picture/Base.hs 220;" f drawTitle src/Dodge/Render/MenuScreen.hs 35;" f @@ -3405,7 +3405,7 @@ epText src/Dodge/Inventory/SelectionList.hs 76;" f eqConstr src/SameConstr.hs 17;" f eqPosText src/Dodge/Equipment/Text.hs 5;" f eqTypeToSites src/Dodge/Inventory/RBList.hs 77;" f -equipAllocString src/Dodge/Render/HUD.hs 310;" f +equipAllocString src/Dodge/Render/HUD.hs 311;" f equipAttachPos src/Dodge/Item/Draw.hs 30;" f equipBackgroundEffect src/Dodge/Euse.hs 14;" f equipInfo src/Dodge/Item/Info.hs 141;" f @@ -3488,7 +3488,7 @@ flockACC src/Dodge/Creature/ReaderUpdate.hs 95;" f flockArmourChaseCrit src/Dodge/Creature/ArmourChase.hs 14;" f flockChaseTarget src/Dodge/Creature/Boid.hs 188;" f flockPointTarget src/Dodge/Creature/Boid.hs 204;" f -floorItemPickupInfo src/Dodge/Render/HUD.hs 231;" f +floorItemPickupInfo src/Dodge/Render/HUD.hs 232;" f floorItemSPic src/Dodge/Render/ShapePicture.hs 122;" f floorTo src/Geometry/Zone.hs 12;" f floorWire src/Dodge/Wire.hs 13;" f @@ -3558,7 +3558,7 @@ getCrMoveSpeed src/Dodge/Creature/Statistics.hs 50;" f getCrsFromRooms src/Dodge/Room/Tutorial.hs 357;" f getCrsFromRooms' src/Dodge/Room/Tutorial.hs 344;" f getDebugMouseOver src/Dodge/Update.hs 377;" f -getDistortions src/Dodge/Render.hs 428;" f +getDistortions src/Dodge/Render.hs 441;" f getEdgesCrossing src/Dodge/Path.hs 42;" f getGrenadeHitEffect src/Dodge/HeldUse.hs 1264;" f getInventoryPath src/Dodge/Inventory/Path.hs 9;" f @@ -3574,7 +3574,7 @@ getPJStabiliser src/Dodge/HeldUse.hs 1251;" f getPretty src/AesonHelp.hs 8;" f getPromptTM src/Dodge/Terminal/Type.hs 3;" f getRoomsFromInts src/Dodge/Room/Tutorial.hs 340;" f -getRootItemBounds src/Dodge/Render/HUD.hs 100;" f +getRootItemBounds src/Dodge/Render/HUD.hs 101;" f getRootItemInvID src/Dodge/Inventory/Location.hs 35;" f getSelectedCloseObj src/Dodge/SelectedClose.hs 14;" f getSmoothScrollValue src/Dodge/SmoothScroll.hs 21;" f @@ -3762,7 +3762,7 @@ invDP src/Dodge/ListDisplayParams.hs 30;" f invDT src/Dodge/Item/Grammar.hs 216;" f invDT' src/Dodge/Item/Grammar.hs 221;" f invDimColor src/Dodge/DisplayInventory.hs 186;" f -invHead src/Dodge/Render/HUD.hs 398;" f +invHead src/Dodge/Render/HUD.hs 399;" f invIMDT src/Dodge/Item/Grammar.hs 245;" f invIndents src/Dodge/Item/Grammar.hs 252;" f invItemEffs src/Dodge/Creature/State.hs 63;" f @@ -3956,7 +3956,7 @@ listGuard src/Dodge/Creature/ReaderUpdate.hs 195;" f listSelectionColorPicture src/Dodge/DisplayInventory.hs 302;" f litCorridor90 src/Dodge/Room/RoadBlock.hs 26;" f lmt src/MatrixHelper.hs 53;" f -lnkMidPosInvSelsCol src/Dodge/Render/HUD.hs 387;" f +lnkMidPosInvSelsCol src/Dodge/Render/HUD.hs 388;" f loadDodgeConfig src/Dodge/Config.hs 30;" f loadMusic src/Dodge/SoundLogic/LoadSound.hs 30;" f loadMuzzle src/Dodge/HeldUse.hs 630;" f @@ -4318,7 +4318,7 @@ pbsHit src/Dodge/WorldEvent/ThingsHit.hs 95;" f peZoneSize src/Dodge/Zoning/Pathing.hs 49;" f pedestalRoom src/Dodge/Room/Containing.hs 50;" f penThing src/Dodge/Bullet.hs 214;" f -perMat src/MatrixHelper.hs 59;" f +perMat src/MatrixHelper.hs 60;" f perceptionUpdate src/Dodge/Creature/Perception.hs 24;" f performAction src/Dodge/Creature/Action.hs 54;" f performActions src/Dodge/Creature/Action.hs 39;" f @@ -4686,7 +4686,7 @@ roomsContaining' src/Dodge/Room/Containing.hs 25;" f rootNotrootEff src/Dodge/Item/BackgroundEffect.hs 28;" f rose src/Color.hs 20;" f rotD src/Padding.hs 44;" f -rotMatr src/MatrixHelper.hs 78;" f +rotMatr src/MatrixHelper.hs 79;" f rotU src/Padding.hs 39;" f rotate src/Picture/Base.hs 153;" f rotate3 src/Geometry/Vector3D.hs 48;" f @@ -4739,8 +4739,8 @@ sawtoothFailS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 714;" f scToTS src/Dodge/Event/Input.hs 34;" f scale src/Picture/Base.hs 149;" f scale3 src/Picture/Base.hs 145;" f -scaleMat src/MatrixHelper.hs 70;" f -scaleMatrix src/MatrixHelper.hs 67;" f +scaleMat src/MatrixHelper.hs 71;" f +scaleMatrix src/MatrixHelper.hs 68;" f scaleSH src/Shape.hs 269;" f scalp src/Dodge/Creature/Picture.hs 93;" f scancodeToHotkey src/Dodge/Creature/YourControl.hs 102;" f @@ -4773,11 +4773,11 @@ sectionsSizes src/Dodge/DisplayInventory.hs 201;" f seedStartMenu src/Dodge/Menu.hs 87;" f seedStartOptions src/Dodge/Menu.hs 90;" f segOnCirc src/Geometry.hs 113;" f -selNumPos src/Dodge/Render/HUD.hs 447;" f -selNumPosCardinal src/Dodge/Render/HUD.hs 470;" f +selNumPos src/Dodge/Render/HUD.hs 448;" f +selNumPosCardinal src/Dodge/Render/HUD.hs 471;" f selSecDrawCursor src/Dodge/Render/List.hs 126;" f selSecDrawCursorAt src/Dodge/Render/List.hs 105;" f -selSecSelCol src/Dodge/Render/HUD.hs 501;" f +selSecSelCol src/Dodge/Render/HUD.hs 502;" f selSecSelSize src/Dodge/SelectionSections.hs 143;" f selSecYint src/Dodge/SelectionSections.hs 152;" f selectedItemScroll src/Dodge/Update/Scroll.hs 51;" f @@ -4827,7 +4827,7 @@ setTiles src/Dodge/Layout.hs 67;" f setTreeInts src/Dodge/Room/Tutorial.hs 98;" f setViewDistance src/Dodge/Update/Camera.hs 239;" f setViewPos src/Dodge/Creature/ReaderUpdate.hs 69;" f -setViewport src/Dodge/Render.hs 433;" f +setViewport src/Dodge/Render.hs 446;" f setVol src/Dodge/Config.hs 47;" f setWristShieldPos src/Dodge/Equipment.hs 49;" f setWristShieldPos src/Dodge/Euse.hs 38;" f @@ -5195,7 +5195,7 @@ tractorGunPic src/Dodge/Item/Draw/SPic.hs 437;" f tractorPullPos src/Dodge/TractorBeam/Update.hs 33;" f tractorSPic src/Dodge/TractorBeam/Draw.hs 10;" f tranRot src/Picture/Base.hs 124;" f -transMat src/MatrixHelper.hs 86;" f +transMat src/MatrixHelper.hs 87;" f transToHandle src/Dodge/Item/HeldOffset.hs 26;" f translate src/Picture/Base.hs 116;" f translate3 src/Picture/Base.hs 120;" f @@ -5463,8 +5463,8 @@ vasTightStride src/Shader/Compile.hs 297;" f vecBetweenSpeed src/Dodge/Base.hs 146;" f vecTurnTo src/Dodge/Movement/Turn.hs 19;" f vert src/Shader/Data.hs 102;" f -vertScale src/MatrixHelper.hs 94;" f -vertTrans src/MatrixHelper.hs 102;" f +vertScale src/MatrixHelper.hs 95;" f +vertTrans src/MatrixHelper.hs 103;" f verticalPipe src/Dodge/Picture.hs 19;" f verticalPipe src/Dodge/Placement/Instance/Pipe.hs 6;" f verticalWire src/Dodge/Wire.hs 23;" f @@ -5569,7 +5569,7 @@ yV2 src/Geometry/Vector.hs 205;" f yellow src/Color.hs 17;" f you src/Dodge/Base/You.hs 13;" f youDropItem src/Dodge/Creature/Action.hs 177;" f -yourAugmentedItem src/Dodge/Render/HUD.hs 238;" f +yourAugmentedItem src/Dodge/Render/HUD.hs 239;" f yourControl src/Dodge/Creature/YourControl.hs 28;" f yourDefaultStrideLength src/Dodge/Default/Creature.hs 110;" f yourInfo src/Dodge/Creature/Info.hs 10;" f