Compare commits

..

407 Commits

Author SHA1 Message Date
justin eac80d2b43 Tweak ammo distribution 2025-12-09 23:51:33 +00:00
justin f6e0514408 First implementation of ammo distribution via machine 2025-12-09 23:35:02 +00:00
justin 851b26262a Allow for inventory item bolding 2025-12-09 22:46:57 +00:00
justin bf8c538491 Draw all bloom layers 2025-12-09 10:37:20 +00:00
justin 2b923cd4b6 Simplify analyser machine 2025-12-09 10:10:50 +00:00
justin 23949b02af Simplify analysers 2025-12-09 10:04:45 +00:00
justin 928eab3fd7 Add (cosmetic, indestructible) pipe connecting storage/distributer 2025-12-08 23:09:17 +00:00
justin 8b028c7f94 Start adding machines for storing/distributing items 2025-12-08 22:37:43 +00:00
justin 9e98cdc34b Simplify facade shape coloring 2025-12-07 20:19:27 +00:00
justin 79f86a3158 Simplify tank decorations 2025-12-07 20:11:54 +00:00
justin 6e5d2f147a Remove explicit external terminal color record 2025-12-07 14:24:11 +00:00
justin 1d53ff4277 Tweak charmap; tweak zoom 2025-12-07 12:16:46 +00:00
justin b18ccf12bf Change camera auto zoom to use ratios 2025-12-07 11:57:18 +00:00
justin 126fe4d4e7 Tweak zooming speed 2025-12-06 00:28:41 +00:00
justin 189c3da84f Zoom in when spawning 2025-12-06 00:04:00 +00:00
justin f9ce58b409 Add sound on spawn, allow for filtering of to play sounds 2025-12-05 23:19:06 +00:00
justin a4f8369420 Simplify explosions 2025-12-05 12:05:30 +00:00
justin 4777b94dfc Tweak projectile wall collision position 2025-12-05 10:33:20 +00:00
justin 0a34db312f Add text messages on loading screens 2025-12-05 10:29:16 +00:00
justin 14d50c4242 Cleanup 2025-12-02 22:40:17 +00:00
justin fd401db97f Simplify dust update 2025-12-02 22:25:14 +00:00
justin 22646d1702 Simplify cloud/dust update 2025-12-02 22:20:41 +00:00
justin b2cb8cfe11 Split gasses and clouds 2025-12-02 21:47:17 +00:00
justin 984a114310 Simplify clouds 2025-12-02 21:28:10 +00:00
justin 5dbb67349b Revert "Simplify clouds"
This reverts commit bd50262ca4.
2025-12-02 21:26:28 +00:00
justin 5d0fc10372 Revert "Tweak clouds, bad flicker when fading out with lower clouds beneath"
This reverts commit 8f208189cc.
2025-12-02 21:26:06 +00:00
justin 8f208189cc Tweak clouds, bad flicker when fading out with lower clouds beneath 2025-12-02 21:14:26 +00:00
justin bd50262ca4 Simplify clouds 2025-12-02 21:02:07 +00:00
justin c89d5af6a3 Make clouds use specific upscale filter, break cloud render over walls 2025-12-02 12:43:56 +00:00
justin 25efce7a89 Graphic tweaks/cleanup 2025-12-01 12:37:54 +00:00
justin 1635ce0176 Use downscaling to sixteenth res for bloom 2025-11-30 11:47:14 +00:00
justin 6ebf3f4ef7 Try to set glScissor more sensibly
Not sure what this should be yet though
2025-11-29 15:28:51 +00:00
justin 974f3e96c9 Play with upscaling filters 2025-11-29 09:44:12 +00:00
justin c5c494522c Play with upscaling shaders 2025-11-27 21:59:52 +00:00
justin 2a4fc97125 Tweak cloud lighting 2025-11-25 22:45:48 +00:00
justin a613870d77 Tone down pixel upscaling, removes artifacts 2025-11-25 22:39:09 +00:00
justin 331d0cce73 Play around with upscaling pixel filtering 2025-11-25 21:59:49 +00:00
justin 4cc8f05407 Cleanup 2025-11-25 11:52:04 +00:00
justin 1d177a7e16 Use mipmaps when downscaling bloom 2025-11-25 11:28:37 +00:00
justin c0cfadbdd3 Move towards pixel upscaling filter 2025-11-25 11:04:06 +00:00
justin f5a972d9e2 Bind dummy vao once during preloadRender; fix texture shader normals 2025-11-24 12:54:57 +00:00
justin 65d7b93a32 Draw to fullscreen using one triangle 2025-11-23 22:26:06 +00:00
justin 5f29c20d39 Add marimba sounds for crystal hits 2025-11-23 19:39:07 +00:00
justin 92e4552f66 Work on windows 2025-11-23 19:08:22 +00:00
justin 581d832569 Add a base to blocks 2025-11-23 14:14:37 +00:00
justin 2cffe81b75 Slightly restrict texture sizes 2025-11-23 11:00:47 +00:00
justin 74c02291c1 Quick hack to make window rendering passable
Before windows drew even on black backgrounds
2025-11-23 00:24:14 +00:00
justin 229350120a Cleanup 2025-11-22 11:53:18 +00:00
justin 4e6876c983 Cleanup 2025-11-22 11:47:35 +00:00
justin b1bd52b09e Hlint 2025-11-22 11:31:06 +00:00
justin a381633dc8 Fix resetting of immutable chasm/floor data storage on new world load 2025-11-22 11:27:41 +00:00
justin 54ca961496 Cleanup 2025-11-21 20:57:10 +00:00
justin 4d245fe232 Fix facing of cursor backdrop 2025-11-21 17:56:10 +00:00
justin 9796ec576f Test 2025-11-21 17:34:42 +00:00
justin 3e86b6e20a Fix chasm draw bug 2025-11-21 17:31:21 +00:00
justin 94dce64f29 Tweak crystal airlock 2025-11-21 13:27:31 +00:00
justin dc1dca8aa0 Make laser fire above corpses 2025-11-21 12:02:14 +00:00
justin 8bc2d6961f Cleanup 2025-11-21 11:34:06 +00:00
justin 71e7b51c88 Remove distortion framebuffer/graphic resolution option 2025-11-21 11:32:30 +00:00
justin 2500a01cb3 Cleanup 2025-11-21 11:13:29 +00:00
justin f9f4fc02ea Cleanup 2025-11-21 11:02:37 +00:00
justin 9c94e1b3f3 Remove BloomNoZWrite layer 2025-11-21 09:36:56 +00:00
justin 3ceff22f36 Cleanup 2025-11-21 00:25:50 +00:00
justin ed6ebc930e Move shaders 2025-11-20 22:33:37 +00:00
justin f63b47d6c4 Remove VAOs 2025-11-20 22:33:23 +00:00
justin 86794d1da9 Move towards removing VAOs 2025-11-20 22:20:53 +00:00
justin 80957d5470 Fix another layered circle rendering bug 2025-11-20 21:58:41 +00:00
justin 8f65a652ce Fix circle layer offset bug, all shaders working without geom 2025-11-20 21:36:18 +00:00
justin 4e7bd4831d Draw circles without using a geometry shader, layer offset broken 2025-11-20 21:29:21 +00:00
justin 5c5d9ef0e3 Move closer to removing all geom shaders 2025-11-20 17:45:15 +00:00
justin d28e3bef6c Make picture shader inputs multiples of 4 2025-11-20 17:09:54 +00:00
justin d0aef5cf39 Tweak picture shader verxs 2025-11-20 17:02:05 +00:00
justin cb64be4eeb Commit before removing geometry shader from ellipses 2025-11-20 16:30:41 +00:00
justin bbb682242d Cleanup 2025-11-20 16:05:02 +00:00
justin 602b162d41 Separate cloud & surface lighting 2025-11-20 14:01:54 +00:00
justin 1f1fa36b72 Cleanup 2025-11-20 12:45:45 +00:00
justin 0491a71da1 Improve window drawing 2025-11-20 12:34:36 +00:00
justin 6563d87247 Work on transparency of windows/clouds 2025-11-20 12:02:05 +00:00
justin 10dbb238c8 Clarify number of distortions, play with distorting bullets 2025-11-19 21:49:20 +00:00
justin 610936a5fa Allow independent distortion of rgb channels 2025-11-19 10:38:30 +00:00
justin 8759431fec Limit number of distortions to 10 2025-11-18 23:10:36 +00:00
justin b633b9d55f Allow for multiple distortions at once 2025-11-18 22:49:51 +00:00
justin 8428f08ebd Work on distortions 2025-11-18 10:55:46 +00:00
justin 1205823ddb Work on distortion shader 2025-11-15 23:17:44 +00:00
justin d436b853eb Work on distortion shader 2025-11-15 13:21:11 +00:00
justin 5dfc97a683 Work on distortion shaders 2025-11-14 22:28:22 +00:00
justin 60a2054cd5 Add linear filtering for distortion texture mipmaps 2025-11-14 12:48:45 +00:00
justin a24ee66f51 Clamp framebuffer textures to edges 2025-11-14 12:41:44 +00:00
justin 9fc36ec54c Cleanup 2025-11-14 11:48:00 +00:00
justin 91917dbddd Remove unused shader code 2025-11-14 11:27:16 +00:00
justin 836fefb9a5 Allow more control over cloud shadows 2025-11-14 11:19:34 +00:00
justin 0eb2fe50a6 Don't draw shadowed walls 2025-11-14 11:06:39 +00:00
justin db62de75d8 Tweak 2025-11-14 10:53:53 +00:00
justin 16eb356e31 Tweak 2025-11-14 10:18:46 +00:00
justin 21c6e3afb4 Make cloud position only record the central point of the cloud 2025-11-14 09:29:26 +00:00
justin bfd7aa619e Move pair to V2 2025-11-14 02:13:03 +00:00
justin 292a1c3f42 Add scissor test when creating lightmap 2025-11-14 02:06:51 +00:00
justin c79e5df683 Cleanup 2025-11-14 01:32:09 +00:00
justin 295a5f7e1d Cleanup, overpower bloom 2025-11-13 23:31:16 +00:00
justin cffa75c014 Draw floors using vertex pulling 2025-11-13 22:22:19 +00:00
justin 836c0ba772 Draw chasms using vertex pulling 2025-11-13 21:58:40 +00:00
justin ec1216e7eb General cleanup 2025-11-13 21:13:13 +00:00
justin 227f09eeda Cleanup 2025-11-13 18:23:45 +00:00
justin 71ae82ee4d Reduce poked cloud verx size 2025-11-13 18:09:12 +00:00
justin b6ab281842 Increase base buffer texture format size 2025-11-13 17:54:36 +00:00
justin a7a11ccc03 Cleanup shaders 2025-11-13 17:52:01 +00:00
justin 0ea7af4bdd Simplify shader records 2025-11-13 14:57:46 +00:00
justin 56aa8c6697 Shaders: work on fullscreen, cleanup creation 2025-11-13 11:18:28 +00:00
justin 8dee93991a Vertex pull fullscreen lighting texture shader 2025-11-13 10:28:34 +00:00
justin b012d3c41e Cleanup, correcly filter unimportant shadow silhouettes 2025-11-12 23:10:33 +00:00
justin 5e9d337288 Cleanup shadows 2025-11-12 22:54:43 +00:00
justin cdf998a1e2 Start cleanup of shader records 2025-11-12 21:37:28 +00:00
justin be64e786f9 Cleanup 2025-11-12 21:23:03 +00:00
justin 383beeae82 Readd dust cloud rendering 2025-11-12 20:53:37 +00:00
justin 409180959c Use vertex pulling for clouds 2025-11-12 19:57:07 +00:00
justin ce1937c78e Improve normal packing and unpacking 2025-11-11 21:47:39 +00:00
justin 4121bfb468 Reduce shape vertex size to 8 floats
It is not at all clear whether this is an improvement or not
2025-11-11 21:12:50 +00:00
justin ce438b7ecd Pack shape normals into a word8 2025-11-11 21:03:02 +00:00
justin 7f6e7d2741 Get shape shader working using vertex pulling
Seems slow, will try to improve
2025-11-11 18:54:48 +00:00
justin f136d0cd19 Cleanup window buffers 2025-11-11 18:08:55 +00:00
justin ceba6fd533 Cleanup some silhouette edge buffers 2025-11-11 17:45:30 +00:00
justin 4d59d521ac Cleanup 2025-11-11 17:22:55 +00:00
justin c5034b3c4c Use ssbos for edge shadows
Seems quite slow as is
2025-11-11 16:23:39 +00:00
justin 219c574931 Use ssbo/vertex pulling for lighting cap shader
Not yet sure whether the colour vector is correctly input into the ssbo
2025-11-11 14:15:42 +00:00
justin a65a1cab93 Work towards using vertex pulling for lighting caps, alignment issues 2025-11-11 12:33:33 +00:00
justin 36d5edc0a6 Use vertex pulling for wall shadows 2025-11-10 21:33:56 +00:00
justin 1a85d9d562 Use vertex pulling for ceiling stencil 2025-11-10 19:15:07 +00:00
justin 1f01147821 Draw walls using vertex pulling 2025-11-10 19:05:54 +00:00
justin 1546caa6a3 Cleanup 2025-11-10 14:55:46 +00:00
justin df435819eb Window render bugfix 2025-11-10 14:08:34 +00:00
justin 5e93c7631d First implementation of SSBO, vertex pulling 2025-11-10 11:58:11 +00:00
justin 187751ec26 Move from glNamedBufferData to glNamedBufferStorage 2025-11-09 21:11:55 +00:00
justin 7ae50adb55 Cleanup 2025-11-09 16:42:55 +00:00
justin 658da193b7 Cleanup 2025-11-09 16:12:17 +00:00
justin cd7a5dcbb5 Simplify block/wall destruction
This uses a right fold, so might be slower than a strict left fold
2025-11-09 16:00:46 +00:00
justin 6f3632d495 Cleanup 2025-11-09 15:41:19 +00:00
justin 5a40eac4e2 Move wall destruction 2025-11-09 14:37:45 +00:00
justin 09f7cc309b Cleanup 2025-11-09 12:06:34 +00:00
justin 397980a83f Simplify props (should they be removed?) 2025-11-09 11:59:59 +00:00
justin dd4ac80159 Remove old Prop update 2025-11-09 11:38:17 +00:00
justin e20cc593fc Cleanup 2025-11-09 11:31:29 +00:00
justin e9ffeeaea7 Work on cloud/window transparency 2025-11-09 11:00:12 +00:00
justin 7c62479f30 Tweak clouds 2025-11-06 22:01:24 +00:00
justin 05c530eeb1 Play around with alpha blending 2025-11-04 10:42:18 +00:00
justin 833d4562e2 Fix rendering without shadows 2025-11-02 22:58:06 +00:00
justin 55252bfe22 Add files 2025-11-02 22:09:07 +00:00
justin 8d79e96798 Add files 2025-11-02 22:07:15 +00:00
justin cf6cd3cd83 Add shader files 2025-11-02 22:06:59 +00:00
justin 2f0487a424 Simplify ceiling oclusions 2025-11-02 19:20:57 +00:00
justin 0d0c1a72e0 Stencil out windows over ceilings 2025-11-01 11:41:08 +00:00
justin d35a41944c Start implementing ceiling stencil shader 2025-11-01 11:24:08 +00:00
justin 71006e24fd Simplify wall lighting shader 2025-10-30 11:17:06 +00:00
justin c2e5aaa7a0 Broken implementation of window colours, move towards stencil ceilings 2025-10-29 21:48:09 +00:00
justin 40c1907689 Cleanup 2025-10-29 12:18:55 +00:00
justin c9ec962575 Cleanup 2025-10-29 12:09:05 +00:00
justin a3b343dfab Unify dust and cloud poking 2025-10-29 11:59:18 +00:00
justin e8d2407367 Fix dust rendering 2025-10-29 11:37:57 +00:00
justin 5f0ab2223d Start simplifying cloud shader 2025-10-29 11:14:08 +00:00
justin 042bd6bc01 Replace glDrawBuffers with glNamedFramebufferDrawBuffers 2025-10-28 13:34:11 +00:00
justin 10503da955 Improve window drawing 2025-10-28 09:58:44 +00:00
justin d6c4d3d609 Fix shockwave damage radius for walls 2025-10-28 08:09:44 +00:00
justin 20042fcf8d Simplify laser reflection/refraction 2025-10-27 19:41:52 +00:00
justin 7c40db7153 Fix pathing for zChasm 2025-10-27 19:07:04 +00:00
justin 323a50ed31 Get out external function for grid room positions 2025-10-27 17:22:55 +00:00
justin 329fcc237b Work on grid for room placements 2025-10-27 17:08:16 +00:00
justin 0946ee1310 Try to simplify link code in roomRect 2025-10-27 15:10:19 +00:00
justin c88fc1c729 Simplify grid/lattice creation 2025-10-27 12:21:18 +00:00
justin 437f5d44d8 Work on grid point creation 2025-10-27 11:50:18 +00:00
justin c676005219 Cleanup 2025-10-27 00:09:11 +00:00
justin aa82519e05 Fix bugs in zones near segments 2025-10-27 00:03:57 +00:00
justin c641cbaa69 Commit before adding more debugging control 2025-10-26 16:55:22 +00:00
justin 0adf3f57b4 Add destruction to mounted lights 2025-10-26 14:39:33 +00:00
justin c55c3e874d Hack solution to path graph space leak: evaluate all edge obstacles 2025-10-26 11:38:22 +00:00
justin b8536e2929 Commit before trying IntMap instead of vector for incidence graph 2025-10-26 08:31:54 +00:00
justin 61910785c4 Cleanup door mounts, noticed space leak when no debug-display paths 2025-10-25 22:49:37 +01:00
justin cbf0f47b9b Allow for easier mounted objects on doors 2025-10-25 18:44:34 +01:00
justin 7585531dd1 Simplify Prop drawing 2025-10-25 13:54:40 +01:00
justin ff03efc41f Simplify Foreground 2025-10-25 13:12:00 +01:00
justin 5fce0772f8 Start simplifying Prop 2025-10-25 13:05:14 +01:00
justin 0da3816664 Cleanup 2025-10-25 10:17:59 +01:00
justin c2cc38a642 Implement different door speeds 2025-10-25 09:57:13 +01:00
justin 3f5f5d2c6b Cleanup 2025-10-24 23:22:16 +01:00
justin b4012af312 Unify PutDoor PSType 2025-10-24 22:31:08 +01:00
justin b6736e2735 Start unifying door placement types 2025-10-24 22:13:30 +01:00
justin 6457f00ba7 Automatically determine automatic doors 2025-10-24 21:08:41 +01:00
justin f94b914ceb Cleanup door placement/auto path generation 2025-10-24 20:51:38 +01:00
justin b0d519c69d Improve some door placement 2025-10-24 20:30:36 +01:00
justin 95b4105f52 Simplify block drawing further, store shape of block 2025-10-24 19:39:44 +01:00
justin ffea3a1694 Simplify block drawing 2025-10-24 19:09:23 +01:00
justin ccb809a090 Cleanup 2025-10-24 18:50:09 +01:00
justin 488428b1ef Single source of truth for wall pathing 2025-10-24 14:25:19 +01:00
justin 0eeae7e6bc Work on wall materials etc 2025-10-24 13:30:46 +01:00
justin 9eed2706b0 Work on autodoor pathing 2025-10-24 13:19:21 +01:00
justin 7b622c8e31 Cleanup 2025-10-24 13:08:44 +01:00
justin 27569ed8f3 Cleanup 2025-10-24 11:16:30 +01:00
justin 18ab89d3f2 Cleanup 2025-10-24 10:58:01 +01:00
justin c39f99e146 Update pathing on block destruction without relying on _blObstructs 2025-10-24 10:34:27 +01:00
justin 9a3c642684 Apply different damage amounts to different materials 2025-10-24 10:08:36 +01:00
justin b2265297b5 Commit before apply different damage amounts to different materials 2025-10-24 09:28:09 +01:00
justin 8f17582889 Fix low block drawing bug 2025-10-23 22:48:06 +01:00
justin cba0f36ac5 Simplify machine placement 2025-10-23 22:34:50 +01:00
justin 3c6d269d00 Remove separate wall color, should be handled by material type 2025-10-23 21:27:14 +01:00
justin 819f0d37ea Start simplifying/removing Wall records 2025-10-23 18:11:01 +01:00
justin fc7c4d6468 Start to make wall flags/pathing interaction more sensible 2025-10-23 11:35:24 +01:00
justin 9e6534b8f4 Simplify doors somewhat, unsure what to do about edge obstacles 2025-10-22 23:09:09 +01:00
justin 0fd7ba46b5 Door destruction happens during door update, updates pathing 2025-10-22 22:47:10 +01:00
justin 151c037763 Fix path updating when doors move 2025-10-22 22:27:09 +01:00
justin 59472b16d2 Improve xIntercepts (still not perfect) 2025-10-22 22:07:45 +01:00
justin d5f985f3ab Start to clean up Prop datatype 2025-10-22 12:07:06 +01:00
justin af245fb5bf Partially working mounts on lerp doors 2025-10-22 11:03:46 +01:00
justin f8073381ee Correctly update wall zoning when door moves 2025-10-22 10:08:23 +01:00
justin 30da635990 Cleanup 2025-10-22 09:30:19 +01:00
justin 2f06c56185 Migrate more doors to lerp 2025-10-22 09:22:10 +01:00
justin fdee74ff0c First implementation of doors that lerp position/float pairs 2025-10-21 23:39:57 +01:00
justin 39677c3a02 Move towards unifying door movement 2025-10-21 23:13:36 +01:00
justin 2f3a00a971 Commit before potential Door refactor 2025-10-21 19:56:48 +01:00
justin fcffbd5f43 Update path zoning on reading a save 2025-10-21 15:50:49 +01:00
justin 1918fc8c56 Comment out FGL 2025-10-21 15:43:23 +01:00
justin 6742241e5d Continue to work on pathfinding 2025-10-21 15:35:37 +01:00
justin 0b997579ad Initial replacement of FGL with incidence representation, use A* 2025-10-21 11:47:49 +01:00
justin c250448d57 Work on perhaps replacing FGL with incidence vectors 2025-10-20 13:07:52 +01:00
justin b2fd0543dd Cleanup, remove DeriveGeneric language extensions 2025-10-20 12:10:11 +01:00
justin 2056d8ba0e Comment out DeriveAnyClass extensions 2025-10-19 21:50:43 +01:00
justin b8f6a29e28 Cleanup actions/impulses 2025-10-18 18:01:14 +01:00
justin 4542a6cea6 Simplify creature action/impulse code 2025-10-18 17:32:23 +01:00
justin 11c7b25fe9 Cleanup impulses/actions 2025-10-18 16:00:08 +01:00
justin 4ee389efb1 Remove reified impulses from creature record 2025-10-18 15:42:35 +01:00
justin b43168ae33 Simplify creature impulse chain 2025-10-18 14:34:05 +01:00
justin ebc4b9d715 Simplify creature update 2025-10-18 10:46:27 +01:00
justin f3fafc6bf2 Fix enemy stride/footsteps 2025-10-17 22:32:40 +01:00
justin f969056912 Commit before attempting to simplify creature update 2025-10-17 10:36:19 +01:00
justin c533e88d24 Cleanup 2025-10-17 09:58:37 +01:00
justin 5ba642c20a Allow creatures to path around chasms 2025-10-16 23:52:25 +01:00
justin 0481f6e6f2 Cleanup 2025-10-16 23:04:17 +01:00
justin 0f43e1ad8f Increase zone searching size for initial/end node in pathing 2025-10-16 12:26:43 +01:00
justin 3bfe6f5dfd Fix reversed impulse pathfinding bug 2025-10-16 12:07:10 +01:00
justin df85624a49 Allow more debug interaction 2025-10-16 10:45:37 +01:00
justin 315e6b1c04 Cleanup, fix debug drawing 2025-10-15 23:04:23 +01:00
justin b8006b44cf Cleanup 2025-10-15 20:40:16 +01:00
justin fe95bf381b Delete some reified action/impulse stuff 2025-10-15 20:37:22 +01:00
justin 4d12d6cf2b Cleanup 2025-10-15 20:29:43 +01:00
justin 5e6ed1d793 Make _targetCr an Int id rather than a full creature 2025-10-15 20:09:17 +01:00
justin 57ca53638a Remove a usage of StrategyActions 2025-10-15 19:41:26 +01:00
justin f9bcac915f Commit before trying to remove reified impulses 2025-10-15 14:19:38 +01:00
justin a0c4d62018 Use System.Hclip instead of System.Clipboard 2025-10-15 13:19:34 +01:00
justin e139499ed2 Tweak debug display 2025-10-15 12:17:44 +01:00
justin 365821e969 Add selection box on left click drag 2025-10-14 12:41:53 +01:00
justin 7a431f6eec Move debug pictures out of data 2025-10-14 11:23:39 +01:00
justin cadaf00797 Tweak debug display 2025-10-14 10:14:30 +01:00
justin 3d602b4f57 Commit before working on debugging 2025-10-13 23:43:29 +01:00
justin c3a0cb0527 Remove fusePairs, replaces with snapToGrid 2025-10-13 11:33:59 +01:00
justin 6b5090e697 Start work on pathfinding 2025-10-13 06:30:55 +01:00
justin 9e7b7a3f76 Make bouncing grenades stop spinning quicker 2025-10-12 21:35:13 +01:00
justin 8b44538048 Cleanup 2025-10-12 21:13:06 +01:00
justin 408b39f160 Commit before removing pressplates 2025-10-12 20:59:57 +01:00
justin 5e5b24cad0 Cleanup 2025-10-12 20:40:40 +01:00
justin 3206cdebf6 Cleanup projectile update 2025-10-12 18:47:10 +01:00
justin 675f8ade59 Cleanup 2025-10-12 15:08:15 +01:00
justin f312cc41ff Refactor muzzle location when item used, remove saveSlot/seed 2025-10-12 14:54:03 +01:00
justin bbda28cbc1 Cleanup projectile firing 2025-10-12 10:46:27 +01:00
justin 33de1f79b6 Add check to cylinder segment collision, break rocket projectiles 2025-10-12 00:26:48 +01:00
justin 8245115763 Commit before maybe changing bullets to be in 3d space 2025-10-11 12:57:22 +01:00
justin d598d28652 Remove old code 2025-10-11 11:47:45 +01:00
justin 75e93dfcd5 Cleanup 2025-10-11 11:46:39 +01:00
justin 4949d98789 Clarify circle segment intersection 2025-10-11 11:13:35 +01:00
justin 49fb982877 Refactor crPos to be a V3 2025-10-10 13:47:31 +01:00
justin 98ece551c7 cleanup 2025-10-10 11:30:05 +01:00
justin e00bb0b26e Add intersection with cylinders 2025-10-10 11:21:40 +01:00
justin 3ea14a4646 Use some Linear library functions 2025-10-08 18:20:26 +01:00
justin f1ddcaa497 Update default config, general cleanup 2025-10-08 13:48:53 +01:00
justin 031f07f14c Allow bullets to fire above corspes 2025-10-08 10:00:29 +01:00
justin 1e73565900 Add files 2025-10-08 09:20:41 +01:00
justin 4e651fcded Cleanup 2025-10-08 09:20:19 +01:00
justin 77fcf8353a LED tweak 2025-10-08 00:29:00 +01:00
justin 477bb8b4b2 Tweak led attachment orientation 2025-10-07 14:21:40 +01:00
justin 709195ed6a Add led/battery to tutorial 2025-10-07 11:30:59 +01:00
justin e9178f9643 Make chasms remove RoomPos within their boundaries 2025-10-07 10:43:15 +01:00
justin 4cc5477f07 Somewhat simplify RoomPos types 2025-10-05 20:47:28 +01:00
justin 43db5a2ebc Commit before attempting to allow for non-convex chasm shapes 2025-10-05 15:06:19 +01:00
justin b3924fb8b8 Cleanup 2025-10-04 12:30:03 +01:00
justin 993f00ada1 Move generating item combinations graph from load to menu log 2025-10-04 11:22:15 +01:00
justin b519c835fa Move generated graphs to be ignored by git 2025-10-04 10:05:13 +01:00
justin 6eac8fbcf1 Move logs to be ignored by git 2025-10-04 10:02:18 +01:00
justin 861d749665 Remove old save files 2025-10-04 09:54:22 +01:00
justin 31f659e3aa Move saves to generated folder 2025-10-04 09:53:33 +01:00
justin 39fb1963c8 Change config serialisation folder, cleanup unused files 2025-10-04 09:20:44 +01:00
justin 731552fe08 Fix room shift for mounted lights 2025-10-04 01:01:00 +01:00
justin aba855e0a6 Commit before checking where mounted lights became misplaced 2025-10-04 00:34:45 +01:00
justin a642198bfc Add pathing to roomNgon 2025-10-04 00:19:33 +01:00
justin cba3ca784a Cleanup 2025-10-03 20:14:41 +01:00
justin 2d44809900 Simplify room link functions 2025-10-03 18:55:18 +01:00
justin a8348a3515 Tweak bullet magazines 2025-10-03 12:33:28 +01:00
justin 4d1d2f36bc Change bullet magazine shape 2025-10-03 12:19:40 +01:00
justin 5c22ca6662 Continue work on chasm rooms 2025-10-03 11:52:49 +01:00
justin 7e3614c9c8 Work on chasm rooms 2025-10-02 16:58:38 +01:00
justin 013f50f0bc Add file 2025-10-01 17:26:56 +01:00
justin 2973ad6eed Increase default mounted lamp range 2025-10-01 17:26:08 +01:00
justin a2eb0e026b Allow to log position of placement spot 2025-09-29 22:34:44 +01:00
justin bf9a2250da Commit before changing logging of placement spots 2025-09-29 21:58:02 +01:00
justin 9ed6d75853 Pass room id rather than room during placement 2025-09-25 22:31:09 +01:00
justin f5a3486f72 Work on placements 2025-09-25 17:32:02 +01:00
justin 23f61081cf Remove external corpses, handle them as creatures 2025-09-25 09:31:58 +01:00
justin fcb02850d0 Move toward not removing creatures on death 2025-09-25 08:48:20 +01:00
justin 1f14f3d0c3 Correct in placement ordering (was using room id) 2025-09-24 23:09:28 +01:00
justin f51868c84c Allow for ordering of in placements, not fully tested yet 2025-09-24 23:01:22 +01:00
justin eab27fea8b Start updating rooms "in place" during placement 2025-09-24 22:30:15 +01:00
justin 91e67e37dc Work on placements 2025-09-24 22:16:38 +01:00
justin da8230fe00 Cleanup 2025-09-24 12:28:24 +01:00
justin eb068f5335 Remove Annotation datatype 2025-09-24 10:39:34 +01:00
justin 96b95907f2 Move towards removing Annotation 2025-09-24 10:17:18 +01:00
justin a83186e6dd Commit before attempting to remove Annotation datatype 2025-09-24 10:05:44 +01:00
justin 87f1444f5c Cleanup 2025-09-23 21:02:27 +01:00
justin 398b3a1342 Cleanup 2025-09-23 17:34:39 +01:00
justin 6984a34c19 Simplify placements 2025-09-23 17:22:31 +01:00
justin 4074c40083 Small cleanup 2025-09-23 17:17:27 +01:00
justin 60fdd138e3 Remove outplacements 2025-09-23 17:14:30 +01:00
justin a6ca90d7d8 Start to remove explicit "outplacements" 2025-09-23 17:11:07 +01:00
justin ef90e5702b Work on placements 2025-09-23 12:59:28 +01:00
justin a9ecd7de2e Allow for placements to use/update the full GenWorld 2025-09-23 10:41:09 +01:00
justin 5ee78ceffc Simplify room out/in placements 2025-09-23 10:14:19 +01:00
justin d1bb8a985b Commit before tweaking placementn/room generation 2025-09-23 09:52:52 +01:00
justin 4179115023 Tweak tutorial messages 2025-09-20 01:56:34 +01:00
justin b270e18556 Play around with terminal messages 2025-09-20 01:07:23 +01:00
justin b837e6a798 Cleanup 2025-09-19 20:39:17 +01:00
justin d4f2cdd3fd Cleanup 2025-09-19 19:56:12 +01:00
justin 2d856ddf9e Slightly rethink display of inventories and terminals 2025-09-18 19:56:12 +01:00
justin e017a92892 Implement working no-item-airlock zone 2025-09-18 15:23:51 +01:00
justin 4494e47b43 Improve sensor terminal messages 2025-09-18 10:18:53 +01:00
justin 1564b1c721 Cleanup, merge modules 2025-09-18 08:28:09 +01:00
justin f12ae3533c Remove redundant placement generation 2025-09-17 17:36:45 +01:00
justin 8721b31811 Remove parameters from machine damage sensors 2025-09-17 17:33:26 +01:00
justin 103f1e7e99 First implementation of no-item-zone sensor 2025-09-16 22:35:53 +01:00
justin 81d6727d8e Simplify analyser machines somewhat 2025-09-16 21:41:26 +01:00
justin 203919933c Work on detecting floor items near analyser 2025-09-08 11:37:08 +01:00
justin f278af0f30 Make Placement into a product type 2025-09-02 12:31:55 +01:00
justin dc13c61dca Remove after placements/genWorldPlacements 2025-09-02 12:03:41 +01:00
justin 7b28ec15d1 Remove PickOnePlacements 2025-09-02 12:02:44 +01:00
justin f279494a02 Make autodoor placements use "ordinary" coordinate placements 2025-09-02 11:53:40 +01:00
justin 380c0f6938 Commit before attempting to simplify auto door placement 2025-09-02 11:09:07 +01:00
justin 2261556c16 Add spinning cursor to terminal line read 2025-09-02 10:24:43 +01:00
justin 7fcaac2a01 Allow movement when viewing terminals 2025-09-01 23:51:16 +01:00
justin a478ee0a2a Fix sensor fail tline 2025-09-01 23:29:10 +01:00
justin 8398f0b852 Simplify analyser terminal 2025-09-01 23:24:11 +01:00
justin cbcc7e4fd6 Fix autorifle muzzle flash 2025-09-01 20:24:52 +01:00
justin 89c9337822 Allow for more sounds to be playing at once 2025-09-01 20:12:50 +01:00
justin 85591424fd Add debug test 2025-09-01 17:27:58 +01:00
justin 01228ed2f1 Unify debug pictures 2025-09-01 17:22:16 +01:00
justin 6c3c023ed9 Sum attached held items to determine strength effect 2025-09-01 10:26:43 +01:00
justin 291a35f538 Cleanup, add a slight border to ideal camera zoom 2025-08-31 11:47:45 +01:00
justin 2a0e6d1e6e Cleanup 2025-08-27 22:35:33 +01:00
justin 3c2369d979 Cleanup 2025-08-27 22:06:10 +01:00
justin 871d695574 Cleanup 2025-08-27 19:28:56 +01:00
justin dda0526180 Cleanup 2025-08-27 19:22:01 +01:00
justin 40d2d316cb Cleanup 2025-08-27 18:55:25 +01:00
justin 86696deb56 Continue to refactor body/equipment positionings 2025-08-27 14:40:13 +01:00
justin 9d2a2e6730 Work on refactoring positioning relative to creature body 2025-08-27 12:11:01 +01:00
justin 2e6b7a1b41 Add AimStance to creature posture when Aiming 2025-08-27 11:46:41 +01:00
justin 5cb8be1363 Cleanup equipment item function 2025-08-27 11:33:09 +01:00
justin 5280d428a9 Commit before adding AimStance to Aiming Posture
AMEND: AimStance is also used when AtEase, so this is not a good solution
2025-08-27 11:26:52 +01:00
justin 5880bd8b8c Cleanup 2025-08-27 11:04:50 +01:00
justin 1ef5534bc2 Cleanup 2025-08-27 01:06:04 +01:00
justin 7581c86d93 Cleanup various equipment/right button code 2025-08-27 00:45:58 +01:00
justin 79a0137d54 Cleanup 2025-08-27 00:34:24 +01:00
justin 06d50ac752 Make equipment indices point to item indices 2025-08-26 23:57:02 +01:00
justin 49efe62910 Commit before modifying crEquipment for item locations 2025-08-26 22:13:40 +01:00
justin e5473d1028 Cleanup 2025-08-26 19:35:19 +01:00
justin 1ebdbdd8ae Cleanup 2025-08-26 18:51:14 +01:00
justin b87c3380b8 Refactor triplet to Selection datatype 2025-08-26 18:13:27 +01:00
justin 9034c409e1 Flatten HUDElement 2025-08-26 16:46:02 +01:00
justin 596880f76a Cleanup 2025-08-26 16:19:49 +01:00
justin f7fd747a7c Allow drag selecting outside of the selection section
Does not yet work outside of any selection section.
Need to think about what widths are acceptable to allow for selection.
2025-08-26 12:42:48 +01:00
justin 004c4d1950 Commit before removing "above/below" checks on inventory dragging
I don't think these actually do anything
EDIT: they are actually necessary
2025-08-26 11:38:46 +01:00
justin 5b95bcbf3b Add XInfinity datatype 2025-08-26 10:02:43 +01:00
justin 58c645041f Allow more drag selection to work 2025-08-25 13:30:04 +01:00
justin a2c32907f0 Fix bugs in drag pickup when releasing mouse outside of inventory list 2025-08-25 12:59:12 +01:00
justin 65803c11c9 Cleanup 2025-08-25 11:01:07 +01:00
justin ee884899ef Make game auto-start (no splash menu) 2025-08-25 10:41:26 +01:00
justin 79abdfb33a Fix drag pickup bug 2025-08-25 10:33:05 +01:00
justin 3f6f1b4019 Use NewIntMap InvInt for crInv 2025-08-25 10:21:59 +01:00
justin 25e64d5378 Implement custom at and ix for NewInt types 2025-08-25 00:50:41 +01:00
justin d776c91cfd Fix more item bugs 2025-08-24 23:50:16 +01:00
justin c2daa86463 Fix at least one bug from item refactor, more remain 2025-08-24 21:01:02 +01:00
justin 94f6d5c630 Major item refactor, still broken 2025-08-24 19:34:09 +01:00
justin 22b4be440a Refactor floor items to use centralised items intmap 2025-08-24 13:14:49 +01:00
justin c38d03165f Start refactor storing items in single intmap, done turrets
More checks required
2025-08-24 11:53:21 +01:00
justin 7336177edf Fix close floor item bug 2025-08-23 23:00:19 +01:00
justin fcccd63844 Refactor floor items, removing ids (not fully checked) 2025-08-23 22:10:33 +01:00
justin 32d7120177 Work on airlocks 2025-08-23 17:42:36 +01:00
justin f641805845 Work on placements/room generation 2025-08-22 13:42:51 +01:00
justin e7b52f4487 Simplify layout Annotations 2025-08-21 17:57:02 +01:00
justin befe24e038 Start creating explicit tutorial map 2025-08-21 16:31:04 +01:00
justin 21460ceaa8 Try to autocomplete before doing terminal return 2025-08-20 17:53:39 +01:00
justin 3936e1a386 Improve tab completion, cleanup 2025-08-20 17:15:34 +01:00
justin 9de2a22001 Work on toggle terminals 2025-08-20 17:06:30 +01:00
justin 8557724fb5 Cleanup 2025-08-20 16:50:47 +01:00
justin 4bf9ce59d5 Cleanup, fix damage code terminal bug 2025-08-20 15:59:22 +01:00
justin 9daa27ee8b Cleanup 2025-08-19 21:49:41 +01:00
justin 68cd362aa4 Cleanup 2025-08-19 20:43:35 +01:00
justin 084210ea7d Cleanup close items code 2025-08-19 20:17:27 +01:00
justin a373b31152 Improve terminal update/display 2025-08-19 19:37:36 +01:00
justin 1cfb581e15 Cleanup unused datatypes 2025-08-19 18:11:31 +01:00
justin e1cfe7e163 Hlint pass 2025-08-19 18:05:05 +01:00
justin 5ccbfa1f91 Cancel terminal display if destroyed while displaying 2025-08-19 18:01:23 +01:00
justin b07280e50c Cleanup 2025-08-19 17:29:36 +01:00
justin 2f9cea1b69 Allow for terminals to be deactivated 2025-08-19 13:58:57 +01:00
justin b8581a7862 Work on terminals, add deactive data type status 2025-08-19 13:48:54 +01:00
justin 2f4fcb42e5 Work on press-continue terminal prompts 2025-08-19 11:08:54 +01:00
540 changed files with 34579 additions and 1379095 deletions
+4
View File
@@ -4,3 +4,7 @@
loop.cabal
*.lock
keys.json
log/*
generated/*
tags
ghcidOutput
-3
View File
@@ -1,3 +0,0 @@
# Changelog for loop
## Unreleased changes
-1
View File
@@ -1 +0,0 @@
# loop
+18 -21
View File
@@ -1,39 +1,30 @@
module Main (
main,
) where
module Main (main) where
import Dodge.SoundSelection
import Control.Lens
import Control.Monad
import Control.Parallel
import qualified Data.Map.Strict as M
--import Data.Preload.Render
import qualified Data.Text as T
import Dodge.Concurrent
import Dodge.Config.Load
import Dodge.Config.Update
import Dodge.Config
import Dodge.Data
import Dodge.Event
import Dodge.Initialisation
import Dodge.LoadSeed
import Dodge.Menu
import Dodge.Render
import Dodge.SoundLogic.LoadSound
import Dodge.StartNewGame
import Dodge.TestString
import Dodge.Update
--import qualified IntMapHelp as IM
import Loop
--import Picture
import Preload
import Preload.Render
--import Render
import SDL (($=))
import qualified SDL
--import qualified SDL.Mixer as Mix
import Sound
import System.Directory
main :: IO ()
main = do
-- load the config to get the window size and position
@@ -74,7 +65,7 @@ winConfig x y winpos =
theCleanup :: Universe -> IO ()
theCleanup uv = SDL.cursorVisible $= True >> cleanUpPreload (_preloadData uv)
firstWorldLoad :: Configuration -> IO Universe
firstWorldLoad :: Config -> IO Universe
firstWorldLoad theConfig = do
SDL.cursorVisible $= False
pdata <- doPreload >>= applyWorldConfig theConfig
@@ -97,22 +88,28 @@ firstWorldLoad theConfig = do
, _uvDebug = mempty
, _uvDebugFloat1 = 10
, _uvDebugFloat2 = 0
, _uvDebugV2_1 = 0
, _uvDebugV2_2 = 1
, _uvDebugPut = mempty
, _uvDebugMessageOffset = 0
, _uvSoundQueue = mempty
, _uvDebugPathShowType = PathBetweenDebugV2s
}
return $ u & uvScreenLayers .~ [splashMenu u]
--return $ u & uvScreenLayers .~ [splashMenu u]
return $ startNewGameInSlot 0 u
theUpdateStep :: SDL.Window -> Universe -> IO Universe
theUpdateStep win = doSideEffects <=< updateRenderSplit win
updateRenderSplit :: SDL.Window -> Universe -> IO Universe
updateRenderSplit win u = do
updateUniverse u `par` void (doDrawing win u)
--updateUniverse u `par` void (doDrawing win u)
updateUniverse u `par` doDrawing win u
return $! updateUniverse u
playSoundUnlessRewinding :: Universe -> IO (M.Map SoundOrigin Sound)
playSoundUnlessRewinding u = case w ^. timeFlow of
NormalTimeFlow -> playSoundAndUpdate (_soundData $ _preloadData u) (_playingSounds w) (_toPlaySounds w)
NormalTimeFlow -> playSoundAndUpdate (_soundData $ _preloadData u) (_playingSounds w) (newSoundsToPlay u)
_ -> stopAllSounds >> return M.empty
where
w = _uvWorld u
@@ -139,13 +136,13 @@ doPreload = do
putStrLn "Start sound preload"
lChunks <- loadSounds
putStrLn "Skip music preload!"
-- lMusic <- loadMusic
-- Mix.playMusic Mix.Forever (lMusic IM.! 0)
-- lMusic <- loadMusic
-- Mix.playMusic Mix.Forever (lMusic IM.! 0)
putStrLn "Return PreloadData"
return
PreloadData
{ _renderData = rData
, _soundData = lChunks
--, _musicData = MusicData{_loadedMusic = lMusic}
, _musicData = mempty
, --, _musicData = MusicData{_loadedMusic = lMusic}
_musicData = mempty
}
-483
View File
@@ -1,483 +0,0 @@
{- |
Weapon effects when pulling the trigger. -}
module Dodge.Item.Weapon.TriggerType
where
import Dodge.Data
import Dodge.SoundLogic
import Dodge.Creature.Action (startReloadingWeapon)
import Dodge.WorldEvent (muzzleFlashAt,tempLightForAt)
import Dodge.WorldEvent.Cloud
import Dodge.RandomHelp
import Dodge.Particle.Bullet.Spawn
import Dodge.Item.Attachment.Data
import Dodge.Item.Data
import Geometry
import System.Random
import Control.Lens
import Control.Monad.State
import Data.Maybe
import qualified Data.IntMap.Strict as IM
import Data.Foldable
withThinSmoke
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
withThinSmoke eff cr w = eff cr $ foldl' (flip $ makeThinSmokeAt . (+.+ pos)) w ps
where
dir = _crDir cr
pos = _crPos cr +.+ (_crRad cr +0.5) *.* unitVectorAtAngle dir
ps = (replicateM 5 . randInCirc) 8 & evalState $ _randGen w
withThickSmoke
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
withThickSmoke eff cr w = eff cr $ foldl' (flip $ makeThickSmokeAt . (+.+ pos)) w ps
where
dir = _crDir cr
pos = _crPos cr +.+ (_crRad cr + 15) *.* unitVectorAtAngle dir
ps = (replicateM 20 . randInCirc) 8 & evalState $ _randGen w
{- |
Fires at an increasing rate.
Has different effect after first fire.
Applies ammo check and use cooldown check. -}
rateIncAB
:: Int -- ^ Start rate
-> Int -- ^ End rate
-> (Creature -> World -> World) -- ^ Effect on first fire
-> (Creature -> World -> World) -- ^ Effect on continued fire
-> Creature -- ^ Creature id
-> World
-> World
rateIncAB startRate fastRate shooteff1 shooteff2 cr w
| repeatFire = w
& pointItem %~ ( (itUseRate .~ max fastRate (currentRate - 1))
. (wpLoadedAmmo -~ 1)
. (itUseTime .~ currentRate) )
& shooteff2 cr
| firstFire = w
& pointItem %~ ( (itUseRate .~ startRate - 1)
. (wpLoadedAmmo -~ 1)
. (itUseTime .~ startRate) )
& shooteff1 cr
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointItem = creatures . ix cid . crInv . ix itRef
currentRate = _itUseRate item
repeatFire = _wpReloadState item == 0
&& _itUseTime item == 1
&& _wpLoadedAmmo item > 0
firstFire = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- |
Shoot a weapon rapidly after a warm up.
Applies ammo check as well. -}
withWarmUp
:: Int -- ^ Warm up time (in frames)
-> (Creature -> World -> World)
-- ^ Shoot effect
-> Creature
-> World
-> World
withWarmUp t f cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| _wpReloadState item /= 0 = w
| fState == 0 = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp 100 f)) . (itUseTime .~ 2) )
| t > 2 = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp (t-1) f)) . (itUseTime .~ 2) )
& soundFrom (CrWeaponSound cid) 26 2 0
| t > 0 = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp (t-1) f)) . (itUseTime .~ 2) )
| otherwise = w
& pointerToItem %~ ( (itUse .~ (\_ -> withWarmUp 1 f)) . (wpLoadedAmmo -~ 1) . (itUseTime .~ 2) )
& f cr
& soundFrom (CrWeaponSound cid) 28 2 0
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointerToItem = creatures . ix cid . crInv . ix itRef
fState = _itUseTime item
reloadCondition = _wpLoadedAmmo item == 0
{- | Adds a sound to a creature based world effect.
The sound is emitted from the creature's position. -}
withSound
:: Int -- ^ Sound id
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World -> World
withSound soundid f cr = soundOncePos soundid (_crPos cr) . f cr
withRecoil
:: Float -- ^ Recoil amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature
-> World -> World
withRecoil recoilAmount eff cr = eff cr . over (creatures . ix cid) pushback
where
cid = _crID cr
pushback = over crPos (+.+ rotateV (_crDir cr) (V2 ((-recoilAmount) / _crMass cr ) 0))
{- | Pushes a creature sideways by a random amount.
Applied before the underlying effect. -}
withSidePush
:: Float -- ^ Maximal possible side push amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature
-> World -> World
withSidePush maxSide eff cr w = eff cr . over (creatures . ix cid) push $ w
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, _) = randomR (-maxSide,maxSide) $ _randGen w
-- consider unifying the pushes using a direction vector
{- | Pushes a creature sideways by a random amount.
Applied after the underlying effect. -}
withSidePushAfter
:: Float -- ^ Maximal possible side push amount
-> (Creature -> World -> World)
-- ^ Underlying world effect, takes creature id as input
-> Creature -- ^ Creature id
-> World -> World
withSidePushAfter maxSide eff cr w = over (creatures . ix cid) push . eff cr $ w
where
cid = _crID cr
push = over crPos (+.+ rotateV (_crDir cr) (V2 0 (pushAmount / _crMass cr)))
(pushAmount, _) = randomR (-maxSide,maxSide) $ _randGen w
{- | Applies a world effect and sound effect after an ammo check. -}
shootWithSound
:: Int -- ^ Sound identifier
-> (Creature -> World -> World)
-- ^ Shoot effect, takes creature id as input
-> Creature
-> World
-> World
shootWithSound soundid f cr w
| fireCondition = over (pointerToItem . wpLoadedAmmo) (\ammo -> ammo-1)
$ soundOncePos soundid (_crPos cr)
$ set (pointerToItem . itUseTime) (_itUseRate item)
$ f cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointerToItem = creatures . ix cid . crInv . ix itRef
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- | Applies a world effect and sound effect after an ammo check. -}
shootWithSoundI
:: Int -- ^ Sound identifier
-> (Item -> Creature -> World -> World)
-- ^ Shoot effect, takes creature id as input
-> Item
-> Creature
-> World
-> World
shootWithSoundI soundid f item cr w
| fireCondition = over (pointerToItem . wpLoadedAmmo) (\ammo -> ammo-1)
$ soundOncePos soundid (_crPos cr)
$ set (pointerToItem . itUseTime) (_itUseRate item)
$ f item cr w
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
pointerToItem = creatures . ix cid . crInv . ix itRef
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- |
Applies a world effect after an item use cooldown check. -}
useTimeCheck
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
useTimeCheck f cr w = case theItem ^? itUseTime of
Just 0 -> f cr $ setUseTime w
_ -> w
where
cid = _crID cr
setUseTime = creatures . ix cid . crInv . ix (_crInvSel cr) . itUseTime +~ useRate
theItem = _crInv cr IM.! _crInvSel cr
useRate = fromMaybe 0 $ theItem ^? itUseRate
{- | Applies a world effect after a hammer position check. -}
hammerCheck
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
hammerCheck f cr w = case (_crInv cr IM.! _crInvSel cr) ^? itHammer of
Just HammerUp -> f cr $ setHammerDown w
_ -> setHammerDown w
where
cid = _crID cr
setHammerDown = creatures . ix cid . crInv . ix (_crInvSel cr) . itHammer .~ HammerDown
{- | Applies a world effect after a hammer position check. -}
hammerCheckI
:: (Item -> Creature -> World -> World) -- ^ Underlying effect
-> Item
-> Creature
-> World
-> World
hammerCheckI f it cr w = case it ^? itHammer of
Just HammerUp -> f it cr $ setHammerDown w
_ -> setHammerDown w
where
cid = _crID cr
setHammerDown = creatures . ix cid . crInv . ix (_crInvSel cr) . itHammer .~ HammerDown
{- | Applies a world effect after an ammo check. -}
shoot
:: (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
shoot f cr w
| fireCondition = f cr w & pointerToItem %~
( (wpLoadedAmmo -~ 1) . (itUseTime .~ _itUseRate item) )
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
itRef = _crInvSel cr
item = _crInv cr IM.! itRef
pointerToItem = creatures . ix cid . crInv . ix itRef
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
{- | Applies a world effect after a hammer position check.
Arbitrary inventory position. -}
hammerCheckL
:: (Creature -> Int -> World -> World) -- ^ Underlying effect
-> Creature
-> Int
-> World
-> World
hammerCheckL f cr invid w = case (_crInv cr IM.! invid) ^? itHammer of
Just HammerUp -> f cr invid $ setHammerDown w
_ -> setHammerDown w
where
cid = _crID cr
setHammerDown = creatures . ix cid . crInv . ix invid . itHammer .~ HammerDown
{- | Applies a world effect after an ammo check.
Arbitrary inventory position. -}
shootL
:: (Creature -> Int -> World -> World)
-- ^ Underlying effect
-> Creature
-> Int -- ^ Inventory position
-> World
-> World
shootL f cr invid w
| fireCondition = f cr invid w & pointerToItem %~
( (wpLoadedAmmo -~ 1) . (itUseTime .~ _itUseRate item) )
| reloadCondition = fromMaybe w $ startReloadingWeapon cr w
| otherwise = w
where
cid = _crID cr
item = _crInv cr IM.! invid
pointerToItem = creatures . ix cid . crInv . ix invid
fireCondition = _wpReloadState item == 0
&& _itUseTime item == 0
&& _wpLoadedAmmo item > 0
reloadCondition = _wpLoadedAmmo item == 0
withMuzFlare
:: (Creature -> World -> World) -- ^ Underlying effect
-> Creature
-> World
-> World
withMuzFlare f cr w = tempLightForAt 3 pos . muzzleFlashAt pos2 $ f cr w
where
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
pos2 = _crPos cr +.+ (2 * _crRad cr) *.* unitVectorAtAngle (_crDir cr)
withMuzFlareI
:: (Item -> Creature -> World -> World) -- ^ Underlying effect
-> Item
-> Creature
-> World
-> World
withMuzFlareI f it cr w = tempLightForAt 3 pos . muzzleFlashAt pos2 $ f it cr w
where
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
pos2 = _crPos cr +.+ (2 * _crRad cr) *.* unitVectorAtAngle (_crDir cr)
{- | Applies the effect to a randomly rotated creature. -}
withRandomDir
:: Float -- ^ Max possible rotation
-> (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
withRandomDir acc f cr w = f (cr & crDir +~ a) $ set randGen g w
where
(a, g) = randomR (-acc,acc) $ _randGen w
{- | Applies the effect to a randomly rotated creature. -}
withRandomDirI
:: Float -- ^ Max possible rotation
-> (Item -> Creature -> World -> World)
-- ^ Underlying effect
-> Item
-> Creature
-> World
-> World
withRandomDirI acc f it cr w = f it (cr & crDir +~ a) $ set randGen g w
where
(a, g) = randomR (-acc,acc) $ _randGen w
{- | Creates a bullet with a given velocity, width, and 'HitEffect' -}
withVelWthHiteff
:: Point2 -- ^ Velocity, x direction is forward with respect to the creature
-> Float -- ^ Bullet width
-> HitEffect -- ^ Bullet effect when hitting creature, wall etc
-> Creature -- ^ Creature id
-> World
-> World
withVelWthHiteff vel width hiteff cr = over particles (newbul : )
where
cid = _crID cr
newbul = aGenBulAt (Just cid) pos (rotateV dir vel) hiteff width
dir = _crDir cr
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
{- | Apply the effect to a translated creature. -}
withRandomOffset
:: Float -- ^ Max possible translate
-> (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
withRandomOffset offsetAmount f cr w = f (cr & crPos %~ (+.+ offV)) $ set randGen g w
where
(offsetVal , g) = randomR (-offsetAmount,offsetAmount) $ _randGen w
offV = rotateV (_crDir cr) (V2 0 offsetVal)
-- | Rotates a creature with minimum rotation at least 0.1.
-- Rotates the player creature before applying the effect, other creatures after.
torqueBeforeForced
:: Float -- ^ Max possible rotation (less the 0.1 forced rotation)
-> (Creature -> World -> World)
-- ^ Underlying effect
-> Creature
-> World
-> World
torqueBeforeForced torque feff cr w
| cid == 0 = feff (cr & crDir +~ rot') $ w
& randGen .~ g
& creatures . ix cid . crDir +~ rot'
& cameraRot +~ rot'
| otherwise = feff cr $ set randGen g $ over (creatures . ix cid . crDir) (+rot') w
where
cid = _crID cr
(rot, g) = randomR (-torque,torque) $ _randGen w
rot' | rot < 0 = rot - 0.1
| otherwise = rot + 0.1
-- | Rotates the player creature before applying an effect.
-- Note this currently (29/4/2021) rotates other creatures /after/ applying the effect.
torqueBefore
:: Float -- ^ Max possible rotation
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature -- ^ Creature id
-> World
-> World
torqueBefore torque feff cr w
| cid == 0 = feff (cr & crDir +~ rot) $ w
& randGen .~ g
& creatures . ix cid . crDir +~ rot
& cameraRot +~ rot
| otherwise = set randGen g $ over (creatures . ix cid . crDir) (+rot) $ feff cr w
where
cid = _crID cr
(rot, g) = randomR (-torque,torque) $ _randGen w
-- | Rotate a randomly creature after applying an effect.
torqueAfter
:: Float -- ^ Max possible rotation
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature -- ^ Creature id
-> World
-> World
torqueAfter torque feff cr w
| cid == 0 = rotateScope $ set randGen g $ over cameraRot (+rot) $ feff cr w
| otherwise = set randGen g $ over (creatures . ix cid . crDir) (+rot) $ feff cr w
where
cid = _crID cr
(rot, g) = randomR (-torque,torque) $ _randGen w
rotateScope = creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
. itAttachment . _Just . scopePos %~ rotateV rot
{- | Create multiple bullets with a given spread, a given amount, given velocity,
given width and given 'HitEffect'. -}
spreadNumVelWthHiteff
:: Float -- ^ Spread
-> Int -- ^ Number of bullets
-> Point2 -- ^ Velocity, x is direction of creature
-> Float -- ^ Bullet width
-> HitEffect -- ^ Effect when hitting creature, wall etc
-> Creature -- ^ Creature id
-> World
-> World
spreadNumVelWthHiteff spread num vel wth eff cr w = over particles (newbuls ++) w
where
cid = _crID cr
newbuls = zipWith
(\pos d -> aGenBulAt (Just cid) pos (rotateV d vel) eff wth)
poss dirs
poss = map ((+.+) $ _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr))
$ (replicateM num . randInCirc) 5 & evalState $ _randGen w
dirs = map (_crDir cr +) $ zipWith (+)
[-spread,-spread+(2*spread/fromIntegral num)..]
(randomRs (0,spread/5) (_randGen w))
{- | Create a number of bullets side by side with a given velocity,
given width and given 'HitEffect'. -}
numVelWthHitEff
:: Int -- ^ Amount of bullets
-> Point2 -- ^ Velocity, x axis is direction of creature
-> Float -- ^ Bullet width
-> HitEffect -- ^ Effect when hitting creature, wall etc
-> Creature
-> World
-> World
numVelWthHitEff num vel wth eff cr = over particles (newbuls ++)
where
cid = _crID cr
newbuls = map (\p -> aGenBulAt (Just cid) p (rotateV d vel) eff wth) poss
d = _crDir cr
poss = map (+.+ pos) $ take num offsets
maxOffset = fromIntegral num * 2.5 - 2.5
offsets = map (rotateV d . V2 0) [-maxOffset,5-maxOffset..]
pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle d
{- | Uses '_wpSpread' as a parameter for the current offset angle. -}
randWalkAngle
:: Float -- ^ Max offset angle
-> Float -- ^ Walk speed
-> (Creature -> World -> World) -- ^ Underlying effect
-> Creature -- ^ Creature id
-> World
-> World
randWalkAngle ma aspeed f cr w = w
& f (cr & crDir +~ a)
& creatures . ix cid . crInv . ix i . wpSpread .~ newa
where
cid = _crID cr
a = _wpSpread $ _crInv (_creatures w IM.! cid) IM.! i
(walka, _) = randomR (-aspeed,aspeed) (_randGen w)
newa = min ma $ max (negate ma) (a + walka)
i = _crInvSel $ _creatures w IM.! cid

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.
+1 -2
View File
@@ -1,8 +1,7 @@
{
"_debug_booleans": [
"Show_ms_frame",
"Mouse_position",
"Collision_test"
"Pathing"
],
"_debug_view_clip_bounds": "NoRoomClipBoundaries",
"_gameplay_rotate_to_wall": true,
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
The cortical interface is an incredible interdisciplinary breakthrough
in neurophysiology and computer science.
It allows clients to directly receive information transmitted wirelessly.
We expect this to allow for better, faster learning, allowing
humans to reach unheard of levels of knowledge and ability.
Non-human animal trials did not appear to reduce lifespans significantly.
Human trials are now in progress.
I hate the way the interface just dumps information on you.
The way time just seems to stop...
makes me feel sick.
I heard @name downloaded War and Peace,
but didn't expect it to be in russian.
Took him a week to recover.
What's the deal with the cortical interface?
So, like, what happens if I constantly request info dumps?
Does that mean I live forever?
Temporal distortion is a common side effect when using the cortical interface.
Information is processed near instantaneously, causing other
external events to appear paused.
The cortical interface has some neat uses.
I set up a timer to remind me of our anniversary.
It's great, the AI even suggested the perfect present!
Mood disorders.
Anxiety.
Epilepsy.
Dizzyness, nauseau, tinitus.
Autism.
Schizoprenia.
@@ -0,0 +1,18 @@
Where am I? What year is this? When is this?,Error: Impossible to determine. Cannot resolve with known frame. Presumed outside Earth light cone.
What is this place?,Central hub. Corrupted zones have been sealed off.
Who am I?,"Error: Unkown referent: “I”. Cannot determine what “I” refers to. Possible partial referent: Biological form generated x miliseconds. Partial list features: torso, four limbs, head w/ partial configuration of scanned data."
Who are you?,"Error: Unknown referent: “you”. Terminal connected distributed system, unknown extent."
What should I do?,Error: Unknown objective function. Module “Cat.Imperative” missing.
Are you an AI?,"Terminal connected to distributed system, unkown extent. Can generate respose to finite queries."
How did I get here?,Generated from blueprints and brain scan transmitted in unkown past.
Can you heal me?,Full regeneration upon termination in areas external to central hub. WARNING: Cannot regenerate upon termination within central hub.
What can you do?,"Item synthesis in terminal (over there), requires blueprint. Transport to defective zones."
What are my capabilities?,Err. Basic movement and item acquisition. Items confer new capabilities. WARNING: carry capacity restricted.
How do I get more powerful?,Carry capacity restoration possible: acquire module through door to north.
What is through that door?,Error: Cannot exhaustively describe location.
Can you be less useful?,"Error: No objective function, try “set verbose”. Cannot determine utility of response."
What are your capabilities?,Error: Parse “your → you”: Unknown referent “you”.
,Error: Parse fail
Do you have memory/hard drive?,All events logged with error correction. Future corruption inevitable. Unkown total bits of storage used/available across network.
How long have you existed?,System clock: (random number) + game time
What seed?,
1 Where am I? What year is this? When is this? Error: Impossible to determine. Cannot resolve with known frame. Presumed outside Earth light cone.
2 What is this place? Central hub. Corrupted zones have been sealed off.
3 Who am I? Error: Unkown referent: “I”. Cannot determine what “I” refers to. Possible partial referent: Biological form generated x miliseconds. Partial list features: torso, four limbs, head w/ partial configuration of scanned data.
4 Who are you? Error: Unknown referent: “you”. Terminal connected distributed system, unknown extent.
5 What should I do? Error: Unknown objective function. Module “Cat.Imperative” missing.
6 Are you an AI? Terminal connected to distributed system, unkown extent. Can generate respose to finite queries.
7 How did I get here? Generated from blueprints and brain scan transmitted in unkown past.
8 Can you heal me? Full regeneration upon termination in areas external to central hub. WARNING: Cannot regenerate upon termination within central hub.
9 What can you do? Item synthesis in terminal (over there), requires blueprint. Transport to defective zones.
10 What are my capabilities? Err. Basic movement and item acquisition. Items confer new capabilities. WARNING: carry capacity restricted.
11 How do I get more powerful? Carry capacity restoration possible: acquire module through door to north.
12 What is through that door? Error: Cannot exhaustively describe location.
13 Can you be less useful? Error: No objective function, try “set verbose”. Cannot determine utility of response.
14 What are your capabilities? Error: Parse “your → you”: Unknown referent “you”.
15 Error: Parse fail
16 Do you have memory/hard drive? All events logged with error correction. Future corruption inevitable. Unkown total bits of storage used/available across network.
17 How long have you existed? System clock: (random number) + game time
18 What seed?
@@ -0,0 +1,9 @@
Something has gone wrong.
My last memory is entering the reconstitution scanner.
Though experimental,
this techology theoretically allows for perfect duplication.
But there are strict rules, this would only happen if my old body is...
non-functional.
Hopefully I can take better care of this one.
+40 -40
View File
@@ -1,42 +1,42 @@
X_RANGE 38.37
Y_RANGE 9447512.00
X_RANGE 11.40
Y_RANGE 20574456.00
ORDER OTHER 1
ORDER (157697)#..\/#./targetYouWhenCognizant/updateHumanoid/updateCreature/dimap/dimap/_Wrapped'/updateIMl'/fu... 2
ORDER (165654)updateCloud.finalPos/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functi... 3
ORDER (165606)updateCloud.finalVel/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functi... 4
ORDER (155261)plLineBlock.makePane/plLineBlock.makeWallAt/plLineBlock.insertBlock/plLineBlock.insertBlocks/plL... 5
ORDER (157606)#..\/#./performActions/updateHumanoid/updateCreature/dimap/dimap/_Wrapped'/updateIMl'/functional... 6
ORDER (157522)updateHumanoid/updateCreature/dimap/dimap/_Wrapped'/updateIMl'/functionalUpdate/timeFlowUpdate/u... 7
ORDER (144146)ix/crSetRoots/crUpdateItemLocations/scrollAugNextInSection/checkInventorySelectionExists/updateI... 8
ORDER (157678)chaseCritAwarenessUpdate/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates... 9
ORDER (159529)updateExpBarrel.applyFuseDamage/updateExpBarrel.newCr/#..\/#./updateExpBarrel/updateBarreloid/up... 10
ORDER (165621)updateCloud.(...)/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functiona... 11
ORDER (181320)#..\/#./crSetRoots.f/ix/crSetRoots/crUpdateItemLocations/scrollAugNextInSection/checkInventorySe... 12
ORDER (152512)zonePe.f/zonePe/generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/startSeedGame/... 13
ORDER (158152)ix/updateInv/foldCr.f/foldCr/crUpdate/defaultImpulsive/updateHumanoid/updateCreature/dimap/dimap... 14
ORDER (162804)listSelectionColorPicture.g/listSelectionColorPicture/updateSection.(...)/updateSection/updateSe... 15
ORDER (181178)crUpdateInvidLocations/crUpdateItemLocations/scrollAugNextInSection/checkInventorySelectionExist... 16
ORDER (159623)ix/crCrSpring/crSpring/simpleCrSprings/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateU... 17
ORDER (159633)colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/t... 18
ORDER (163282)updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functionalUpdate/timeFlowUp... 19
ORDER (157730)ix/updateInv/foldCr.f/foldCr/crUpdate/humanoidAIList/updateHumanoid/updateCreature/dimap/dimap/_... 20
ORDER (13951)updateEdgeWallObs 2
ORDER (14169)updateDisplaySections,updateEdgeWallObs 3
ORDER (14505)SYSTEM,updateDisplaySections,doDrawing',colCrsWalls,updateEdgeWallObs 4
ORDER (13997)updateEdgeWallObs 5
ORDER (13996)updateEdgeWallObs 6
ORDER (14223)SYSTEM,updateDisplaySections,updateEdgeWallObs 7
ORDER (14009)updateEdgeWallObs 8
ORDER (14027)updateEdgeWallObs,ix 9
ORDER (13964)SYSTEM,updateEdgeWallObs 10
ORDER (13953)updateEdgeWallObs 11
ORDER (14086)updateEdgeWallObs,ix 12
ORDER (14099)updateEdgeWallObs,ix 13
ORDER (14085)updateEdgeWallObs,ix 14
ORDER (14030)updateEdgeWallObs,ix 15
ORDER (14175)SYSTEM,updateDisplaySections,updateEdgeWallObs 16
ORDER (2)SYSTEM 17
ORDER (13952)SYSTEM,updateEdgeWallObs 18
ORDER (13941)updateEdgeWallObs 19
ORDER (14018)updateEdgeWallObs,ix 20
SHADE OTHER 0.00
SHADE (157697)#..\/#./targetYouWhenCognizant/updateHumanoid/updateCreature/dimap/dimap/_Wrapped'/updateIMl'/fu... 0.00
SHADE (165654)updateCloud.finalPos/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functi... 0.00
SHADE (165606)updateCloud.finalVel/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functi... 0.00
SHADE (155261)plLineBlock.makePane/plLineBlock.makeWallAt/plLineBlock.insertBlock/plLineBlock.insertBlocks/plL... 0.10
SHADE (157606)#..\/#./performActions/updateHumanoid/updateCreature/dimap/dimap/_Wrapped'/updateIMl'/functional... 0.10
SHADE (157522)updateHumanoid/updateCreature/dimap/dimap/_Wrapped'/updateIMl'/functionalUpdate/timeFlowUpdate/u... 0.10
SHADE (144146)ix/crSetRoots/crUpdateItemLocations/scrollAugNextInSection/checkInventorySelectionExists/updateI... 0.10
SHADE (157678)chaseCritAwarenessUpdate/chaseCritPerceptionUpdate/chainCreatureUpdates.unf/chainCreatureUpdates... 0.00
SHADE (159529)updateExpBarrel.applyFuseDamage/updateExpBarrel.newCr/#..\/#./updateExpBarrel/updateBarreloid/up... 0.00
SHADE (165621)updateCloud.(...)/updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functiona... 0.00
SHADE (181320)#..\/#./crSetRoots.f/ix/crSetRoots/crUpdateItemLocations/scrollAugNextInSection/checkInventorySe... 0.00
SHADE (152512)zonePe.f/zonePe/generateLevelFromRoomList/generateWorldFromSeed/startSeedGameConc/startSeedGame/... 0.05
SHADE (158152)ix/updateInv/foldCr.f/foldCr/crUpdate/defaultImpulsive/updateHumanoid/updateCreature/dimap/dimap... 0.05
SHADE (162804)listSelectionColorPicture.g/listSelectionColorPicture/updateSection.(...)/updateSection/updateSe... 0.05
SHADE (181178)crUpdateInvidLocations/crUpdateItemLocations/scrollAugNextInSection/checkInventorySelectionExist... 0.05
SHADE (159623)ix/crCrSpring/crSpring/simpleCrSprings/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateU... 0.10
SHADE (159633)colCrsWalls/functionalUpdate/timeFlowUpdate/updateUniverseMid/updateUniverse/updateRenderSplit/t... 0.10
SHADE (163282)updateCloud/updateObjCatMaybes.(...)/updateObjCatMaybes/updateClouds/functionalUpdate/timeFlowUp... 0.10
SHADE (157730)ix/updateInv/foldCr.f/foldCr/crUpdate/humanoidAIList/updateHumanoid/updateCreature/dimap/dimap/_... 0.10
SHADE (13951)updateEdgeWallObs 0.00
SHADE (14169)updateDisplaySections,updateEdgeWallObs 0.00
SHADE (14505)SYSTEM,updateDisplaySections,doDrawing',colCrsWalls,updateEdgeWallObs 0.00
SHADE (13997)updateEdgeWallObs 0.10
SHADE (13996)updateEdgeWallObs 0.10
SHADE (14223)SYSTEM,updateDisplaySections,updateEdgeWallObs 0.10
SHADE (14009)updateEdgeWallObs 0.10
SHADE (14027)updateEdgeWallObs,ix 0.00
SHADE (13964)SYSTEM,updateEdgeWallObs 0.00
SHADE (13953)updateEdgeWallObs 0.00
SHADE (14086)updateEdgeWallObs,ix 0.00
SHADE (14099)updateEdgeWallObs,ix 0.05
SHADE (14085)updateEdgeWallObs,ix 0.05
SHADE (14030)updateEdgeWallObs,ix 0.05
SHADE (14175)SYSTEM,updateDisplaySections,updateEdgeWallObs 0.05
SHADE (2)SYSTEM 0.10
SHADE (13952)SYSTEM,updateEdgeWallObs 0.10
SHADE (13941)updateEdgeWallObs 0.10
SHADE (14018)updateEdgeWallObs,ix 0.10
+18961 -804685
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+510 -59303
View File
File diff suppressed because it is too large Load Diff
-281
View File
@@ -1,281 +0,0 @@
digraph {
graph [rankdir=LR];
subgraph 1 {
1 [shape=box
,label="EQUIP {_ibtEquip = FUELPACK}"];
5 [shape=box
,label="AMMOMAG {_ibtAmmoMag = TINMAG}"];
9 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 1}}"];
13 [shape=box
,label="HELD {_ibtHeld = PISTOL}"];
15 [shape=box
,label="HELD {_ibtHeld = AUTOPISTOL}"];
17 [shape=box
,label="HELD {_ibtHeld = SMG}"];
20 [shape=box
,label="HELD {_ibtHeld = MACHINEPISTOL}"];
22 [shape=box
,label="HELD {_ibtHeld = BANGCONE}"];
25 [shape=box
,label="HELD {_ibtHeld = BLUNDERBUSS}"];
27 [shape=box
,label="HELD {_ibtHeld = GRAPECANNON {_xNum = 1}}"];
29 [shape=box
,label="HELD {_ibtHeld = RIFLE}"];
31 [shape=box
,label="HELD {_ibtHeld = VOLLEYGUN {_xNum = 3}}"];
33 [shape=box
,label="HELD {_ibtHeld = AUTORIFLE}"];
35 [shape=box
,label="HELD {_ibtHeld = BURSTRIFLE}"];
37 [shape=box
,label="HELD {_ibtHeld = MINIGUNX {_xNum = 3}}"];
40 [shape=box
,label="HELD {_ibtHeld = SNIPERRIFLE}"];
41 [shape=box
,label="HELD {_ibtHeld = AMR}"];
44 [shape=box
,label="HELD {_ibtHeld = AUTOAMR}"];
46 [shape=box
,label="HELD {_ibtHeld = RLAUNCHER}"];
49 [shape=box
,label="HELD {_ibtHeld = RLAUNCHERX {_xNum = 2}}"];
53 [shape=box
,label="HELD {_ibtHeld = FLAMESPITTER}"];
57 [shape=box
,label="HELD {_ibtHeld = BLOWTORCH}"];
59 [shape=box
,label="HELD {_ibtHeld = FLAMETHROWER}"];
61 [shape=box
,label="HELD {_ibtHeld = FLAMEWALL}"];
63 [shape=box
,label="HELD {_ibtHeld = FLAMETORRENT}"];
65 [shape=box,label=LASER];
69 [shape=box
,label="HELD {_ibtHeld = SPARKGUN}"];
71 [shape=box
,label="HELD {_ibtHeld = TESLAGUN}"];
73 [shape=box
,label="HELD {_ibtHeld = BLINKERUNSAFE}"];
74 [shape=box
,label="HELD {_ibtHeld = BLINKER}"];
77 [shape=box
,label="EQUIP {_ibtEquip = MAGSHIELD MagnetRepulse}"];
80 [shape=box
,label="EQUIP {_ibtEquip = POWERLEGS}"];
86 [shape=box
,label="HELD {_ibtHeld = FLATSHIELD}"];
96 [shape=box
,label="DETECTOR {_ibtDetector = ITEMDETECTOR}"];
99 [shape=box
,label="DETECTOR {_ibtDetector = WALLDETECTOR}"];
101 [shape=box
,label="DETECTOR {_ibtDetector = CREATUREDETECTOR}"];
103 [shape=box
,label="HELD {_ibtHeld = TORCH}"];
104 [shape=box
,label="AMMOMAG {_ibtAmmoMag = BATTERY}"];
107 [shape=box
,label="EQUIP {_ibtEquip = HEADLAMP}"];
108 [shape=box
,label="EQUIP {_ibtEquip = HAT}"];
110 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 2}}"];
}
subgraph 2 {
0 [shape=point];
4 [shape=point];
8 [shape=point];
12 [shape=point];
14 [shape=point];
16 [shape=point];
19 [shape=point];
21 [shape=point];
24 [shape=point];
26 [shape=point];
28 [shape=point];
30 [shape=point];
32 [shape=point];
34 [shape=point];
36 [shape=point];
39 [shape=point];
42 [shape=point];
43 [shape=point];
45 [shape=point];
48 [shape=point];
50 [shape=point];
52 [shape=point];
56 [shape=point];
58 [shape=point];
60 [shape=point];
62 [shape=point];
64 [shape=point];
68 [shape=point];
70 [shape=point];
72 [shape=point];
76 [shape=point];
79 [shape=point];
82 [shape=point];
83 [shape=point];
84 [shape=point];
85 [shape=point];
87 [shape=point];
89 [shape=point];
92 [shape=point];
95 [shape=point];
98 [shape=point];
100 [shape=point];
102 [shape=point];
106 [shape=point];
109 [shape=point];
111 [shape=point];
113 [shape=point];
115 [shape=point];
117 [shape=point];
}
0 -> 1 [xlabel="",tailport=e];
4 -> 5 [xlabel="",tailport=e];
8 -> 9 [xlabel="",tailport=e];
9 -> 12 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 28 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 30 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 30 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 30 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 109 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 113 [xlabel=1
,arrowhead=onone
,headport=w];
9 -> 115 [xlabel=1
,arrowhead=onone
,headport=w];
12 -> 13 [xlabel="",tailport=e];
13 -> 14 [xlabel=1
,arrowhead=onone
,headport=w];
14 -> 15 [xlabel="",tailport=e];
15 -> 16 [xlabel=1
,arrowhead=onone
,headport=w];
15 -> 19 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 17 [xlabel="",tailport=e];
19 -> 20 [xlabel="",tailport=e];
21 -> 22 [xlabel="",tailport=e];
22 -> 24 [xlabel=1
,arrowhead=onone
,headport=w];
24 -> 25 [xlabel="",tailport=e];
25 -> 26 [xlabel=1
,arrowhead=onone
,headport=w];
26 -> 27 [xlabel="",tailport=e];
27 -> 117 [xlabel=1
,arrowhead=onone
,headport=w];
28 -> 29 [xlabel="",tailport=e];
29 -> 32 [xlabel=1
,arrowhead=onone
,headport=w];
29 -> 34 [xlabel=1
,arrowhead=onone
,headport=w];
29 -> 42 [xlabel=1
,arrowhead=onone
,headport=w];
30 -> 31 [xlabel="",tailport=e];
31 -> 36 [xlabel=1
,arrowhead=onone
,headport=w];
31 -> 113 [xlabel=1
,arrowhead=onone
,headport=w];
32 -> 33 [xlabel="",tailport=e];
34 -> 35 [xlabel="",tailport=e];
36 -> 37 [xlabel="",tailport=e];
37 -> 115 [xlabel=1
,arrowhead=onone
,headport=w];
39 -> 40 [xlabel="",tailport=e];
41 -> 39 [xlabel=1
,arrowhead=onone
,headport=w];
41 -> 43 [xlabel=1
,arrowhead=onone
,headport=w];
42 -> 41 [xlabel="",tailport=e];
43 -> 44 [xlabel="",tailport=e];
45 -> 46 [xlabel="",tailport=e];
46 -> 48 [xlabel=1
,arrowhead=onone
,headport=w];
48 -> 49 [xlabel="",tailport=e];
49 -> 50 [xlabel=1
,arrowhead=onone
,headport=w];
52 -> 53 [xlabel="",tailport=e];
53 -> 56 [xlabel=1
,arrowhead=onone
,headport=w];
53 -> 58 [xlabel=1
,arrowhead=onone
,headport=w];
56 -> 57 [xlabel="",tailport=e];
58 -> 59 [xlabel="",tailport=e];
59 -> 60 [xlabel=1
,arrowhead=onone
,headport=w];
59 -> 62 [xlabel=1
,arrowhead=onone
,headport=w];
60 -> 61 [xlabel="",tailport=e];
62 -> 63 [xlabel="",tailport=e];
64 -> 65 [xlabel="",tailport=e];
68 -> 69 [xlabel="",tailport=e];
69 -> 70 [xlabel=1
,arrowhead=onone
,headport=w];
70 -> 71 [xlabel="",tailport=e];
72 -> 73 [xlabel="",tailport=e];
74 -> 72 [xlabel=1
,arrowhead=onone
,headport=w];
76 -> 77 [xlabel="",tailport=e];
79 -> 80 [xlabel="",tailport=e];
85 -> 86 [xlabel="",tailport=e];
95 -> 96 [xlabel="",tailport=e];
98 -> 99 [xlabel="",tailport=e];
100 -> 101 [xlabel=""
,tailport=e];
102 -> 103 [xlabel=""
,tailport=e];
103 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
104 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
106 -> 107 [xlabel=""
,tailport=e];
108 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
109 -> 110 [xlabel=""
,tailport=e];
110 -> 111 [xlabel=1
,arrowhead=onone
,headport=w];
}
-145
View File
@@ -1,145 +0,0 @@
Seed: 7114951007332849727Layout with room names:
rezBox-0
|
autoDoor-1
|
rectPillars-2
|
autoDoor-3
|
Corridor-4
|
autoDoor-5
|
ElecautoRect-6
|
+- triggerDoorRoom-7
| |
| autoDoor-8
| |
| autoDoor-9
| |
| Corridor-10
| |
| autoDoor-11
| |
| 8gon-12
| |
| triggerDoorRoom-13
| |
| autoDoor-14
| |
| autoDoor-15
| |
| Corridor-16
| |
| autoRect-17
| |
| autoDoor-18
| |
| Corridor-19
| |
| autoDoor-20
| |
| 6gon-21
| |
| +- triggerDoorRoom-22
| | |
| | autoDoor-23
| | |
| | autoDoor-24
| | |
| | Corridor-25
| | |
| | autoDoor-26
| | |
| | warningTerm-8gon-27
| | |
| | triggerDoorRoom-28
| | |
| | autoDoor-29
| | |
| | autoDoor-30
| | |
| | Corridor-31
| | |
| | autoRect-32
| | |
| | autoDoor-33
| | |
| | Corridor-34
| | |
| | autoDoor-35
| | |
| | Corridor-36
| | |
| | 8gon-37
| | |
| | triggerDoorRoom-38
| | |
| | autoDoor-39
| | |
| | autoDoor-40
| | |
| | Corridor-41
| | |
| | tanksRoom-42
| | |
| | autoDoor-43
| | |
| | Corridor-44
| | |
| | autoDoor-45
| | |
| | rect-46
| | |
| | +- autoDoor-47
| | | |
| | | autoDoor-48
| | | |
| | | Corridor-49
| | | |
| | | autoRect-50
| | | |
| | | defaultRoom-51
| | | |
| | | autoRect-52
| | | |
| | | defaultRoom-53
| | | |
| | | autoRect-54
| | | |
| | | autoDoor-55
| | | |
| | | Corridor-56
| | | |
| | | autoDoor-57
| | | |
| | | 8gon-58
| | | |
| | | triggerDoorRoom-59
| | | |
| | | autoDoor-60
| | | |
| | | autoDoor-61
| | | |
| | | Corridor-62
| | | |
| | | defaultRoom-63
| | |
| | Corridor-64
| | |
| | autoDoor-65
| |
| autoDoor-66
| |
| Corridor-67
| |
| autoRect-68
|
autoDoor-69
|
Corridor-70
|
autoRect-71
-4
View File
@@ -1,4 +0,0 @@
Generating level with seed 7114951007332849727
After 1 attempt(s), Successful generation of level with seed 7114951007332849727
72 rooms in total
-1139
View File
File diff suppressed because it is too large Load Diff
-267
View File
@@ -1,267 +0,0 @@
Seed: 7114951007332849727
0:startThenWeaponRoom
|
1:corDoor
|
2:PassthroughLockKeyLists-HELD {_ibtHeld = SPARKGUN}
|
3:corDoor
|
4:lasSensorTurretTest
|
5:corDoor
|
6:SingleRoom
|
7:corDoor
|
8:PassthroughLockKeyLists-HELD {_ibtHeld = KEYCARD 0}
|
9:corDoor
|
10:warningRooms
|
11:corDoor
|
12:chaseCrit+armourChaseCrit rectRoom
|
13:corDoor
|
14:healthTest
|
15:corDoor
|
16:empty tanksRoom
|
17:corDoor
|
18:PassthroughLockKeyLists-HELD {_ibtHeld = SNIPERRIFLE}
|
19:corDoor
|
20:shootingRange
|
21:corDoor
|
22:lasSensorTurretTest
|
23:corDoor
|
24:randomFourCornerRoom
0:0:startThenWeaponRoom
|
0:1:weaponBetweenPillars_BANGSTICK4
0:0:0:rezBox'
0:0:0:0:rezBox
|
0:0:0:1:autoDoor
0:1:0:rectPillars
1:0:corDoor
1:0:0:autoDoor
|
1:0:1:Corridor
2:0:PassthroughLockKeyLists-HELD {_ibtHeld = SPARKGUN}
2:0:0:RassThroughLockKeyLists
|
2:0:1:roomsContaining chaseCritchaseCritTRANSFORMERCANCAN
2:0:0:0:sensorRoomRunPast
2:0:0:0:0:autoDoor
|
2:0:0:0:1:ElecautoRect
|
+- 2:0:0:0:2:triggerDoorRoom
| |
| 2:0:0:0:3:autoDoor
|
2:0:0:0:4:autoDoor
|
2:0:0:0:5:Corridor
2:0:1:0:autoRect
3:0:corDoor
3:0:0:autoDoor
|
3:0:1:Corridor
4:0:lasSensorTurretTest
4:0:0:autoDoor
|
4:0:1:8gon
|
4:0:2:triggerDoorRoom
|
4:0:3:autoDoor
5:0:corDoor
5:0:0:autoDoor
|
5:0:1:Corridor
6:0:SingleRoom
6:0:0:autoRect
7:0:corDoor
7:0:0:autoDoor
|
7:0:1:Corridor
8:0:PassthroughLockKeyLists-HELD {_ibtHeld = KEYCARD 0}
8:0:0:RassThroughLockKeyLists
|
8:0:1:roomsContaining chaseCritchaseCritchaseCritKEYCARD 0
8:0:0:0:keyCardRoomRunPast
8:0:0:0:0:autoDoor
|
8:0:0:0:1:6gon
|
+- 8:0:0:0:2:triggerDoorRoom
| |
| 8:0:0:0:3:autoDoor
|
8:0:0:0:4:autoDoor
|
8:0:0:0:5:Corridor
8:0:1:0:autoRect
9:0:corDoor
9:0:0:autoDoor
|
9:0:1:Corridor
10:0:warningRooms
10:0:0:autoDoor
|
10:0:1:warningTerm-8gon
|
10:0:2:triggerDoorRoom
|
10:0:3:autoDoor
11:0:corDoor
11:0:0:autoDoor
|
11:0:1:Corridor
12:0:chaseCrit+armourChaseCrit rectRoom
12:0:0:autoRect
13:0:corDoor
13:0:0:autoDoor
|
13:0:1:Corridor
14:0:healthTest
14:0:0:autoDoor
|
14:0:1:Corridor
|
14:0:2:8gon
|
14:0:3:triggerDoorRoom
|
14:0:4:autoDoor
15:0:corDoor
15:0:0:autoDoor
|
15:0:1:Corridor
16:0:empty tanksRoom
16:0:0:tanksRoom
17:0:corDoor
17:0:0:autoDoor
|
17:0:1:Corridor
18:0:PassthroughLockKeyLists-HELD {_ibtHeld = SNIPERRIFLE}
18:0:0:RassThroughLockKeyLists
|
18:0:1:roomsContaining chaseCritchaseCritSNIPERRIFLE
18:0:0:0:longRoomRunPast
18:0:0:0:0:autoDoor
|
18:0:0:0:1:rect
|
+- 18:0:0:0:2:autoDoor
|
18:0:0:0:3:Corridor
|
18:0:0:0:4:autoDoor
18:0:1:0:rectPillars
19:0:corDoor
19:0:0:autoDoor
|
19:0:1:Corridor
20:0:shootingRange
20:0:0:autoRect
|
20:0:1:defaultRoom
|
20:0:2:autoRect
|
20:0:3:defaultRoom
|
20:0:4:autoRect
21:0:corDoor
21:0:0:autoDoor
|
21:0:1:Corridor
22:0:lasSensorTurretTest
22:0:0:autoDoor
|
22:0:1:8gon
|
22:0:2:triggerDoorRoom
|
22:0:3:autoDoor
23:0:corDoor
23:0:0:autoDoor
|
23:0:1:Corridor
24:0:defaultRoom
BIN
View File
Binary file not shown.
+5 -4
View File
@@ -6,9 +6,9 @@ author: "Author name here"
maintainer: "example@example.com"
copyright: "2021 Author name here"
extra-source-files:
- README.md
- ChangeLog.md
# extra-source-files:
# - README.md
# - ChangeLog.md
# Metadata used when publishing your package
# synopsis: A basic game loop
@@ -50,11 +50,12 @@ dependencies:
- primitive
- monad-parallel
- parallel
- Clipboard
- tasty
- tasty-hunit
- tasty-quickcheck
- list-tries
- Hclip
- search-algorithms
library:
source-dirs: src
-1
View File
File diff suppressed because one or more lines are too long
-496124
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
7114951007332849727
+13
View File
@@ -0,0 +1,13 @@
#version 450 core
struct PosTex { vec4 pospos; vec4 texang; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 2) readonly buffer Pos { PosTex data[]; };
int indices[6] = {0,1,3,0,3,2};
void main()
{
vec4 pp = data[gl_VertexID / 6].pospos;
int j = indices[gl_VertexID % 6];
float z = (j / 2 > 0.5 ? 5000 : 100);
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
gl_Position = theMat * vec4(xy,z,1);
}
+6
View File
@@ -0,0 +1,6 @@
#version 450 core
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 7) readonly buffer Pos { vec2 pos[]; };
void main() {
gl_Position = theMat * vec4(pos[gl_VertexID],0,1);
}
+5 -14
View File
@@ -1,27 +1,18 @@
#version 450 core
in vec4 vPosID;
in vec4 vCol;
in vec4 vCenterSize;
in vec4 vControls;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=2) out vec4 fNorm;
void main()
{
// there are quite a few intricate controls concerning the normals
// we want normals to be bigger towards the center, so that when two clouds
// are blended central normals predominate
// similarly, we want normals to be bigger the further up the cloud is
// finally, we want normals to allow for shadows at the edge of a cloud
// when a light is direcly above the cloud
float d = dot(vControls,vControls);
if (d > 1) {discard;}
//fCol = vCol;
fCol = vec4(vCol.xyz,vCol.w*(1-d));
//float rad = vCenterSize.w*0.5;
float rad = vCenterSize.w;
float h = (1-d) * rad;
fPos = vec4(vPosID.xy, vPosID.z + h, vCol.w*(1-d));
vec3 fn1 = fPos.z*normalize(vec3(vCenterSize.xyz - fPos.xyz));
fNorm = vec4(fn1,fPos.w);
fPos = vec4(vPosID.xyz, vCol.w*(1-d));
//fPos = vec4(vPosID.xy,vPosID.z*0.5, vCol.w*(1-d));
fNorm = vec4(-vControls.xy, -0.1 + 0.2 * d ,fPos.w);
//fNorm = vec4(-vControls.xy, -0.1 + 2 * d ,vCol.w * (1.01-(d*d*d)));
//fNorm = vec4(-vControls.xy, -0.1 + d , fPos.w);
}
+1 -4
View File
@@ -1,18 +1,15 @@
#version 450 core
layout (location = 0) in vec4 posID;
layout (location = 1) in vec4 col;
layout (location = 2) in vec4 centerSize;
layout (location = 3) in vec4 controls;
layout (location = 2) in vec4 controls;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vPosID;
out vec4 vCol;
out vec4 vCenterSize;
out vec4 vControls;
void main()
{
gl_Position = theMat * vec4(posID.xyz,1);
vPosID = posID;
vCol = col;
vCenterSize = centerSize;
vControls = controls;
}
-14
View File
@@ -1,14 +0,0 @@
#version 450 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec4 col;
layout (location = 2) in vec3 boxXboxYwidth;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vCol;
out vec3 vPos;
out vec3 vparams;
void main() {
gl_Position = theMat * vec4(pos,1);
vCol = col;
vparams = boxXboxYwidth;
vPos = pos;
}
-11
View File
@@ -1,11 +0,0 @@
#version 450 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec4 col;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vCol;
out vec3 vPos;
void main() {
gl_Position = theMat * vec4(pos,1);
vCol = col;
vPos = pos;
}
-9
View File
@@ -1,9 +0,0 @@
#version 450 core
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
in vec4 vCol;
in vec3 vPos;
void main() {
fCol = vCol;
fPos = vec4(vPos,1) ;
}
-14
View File
@@ -1,14 +0,0 @@
#version 450 core
layout (location = 0) in vec4 position;
layout (location = 1) in vec4 color;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vCol;
out vec3 vPos;
void main()
{
vec4 posxy = theMat * vec4(position.xyz,1);
vec4 posz = theMat * vec4(position.xyw,1);
gl_Position = vec4(posxy.xy,posz.z,1);
vCol = color;
vPos = position.xyz;
}
-18
View File
@@ -1,18 +0,0 @@
#version 450 core
in vec4 vColor;
in vec2 boxOut;
in vec2 boxIn;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
void main()
{
//float d = x - y - 1 + 2* sqrt(y);
float d = sqrt(boxOut.x) + sqrt(boxOut.y) - 1.0;
// float e = sqrt(f(x,wStart)) + sqrt(f(y,wEnd)) - 1.0;
float e = sqrt(boxIn.x) + sqrt(boxIn.y) - 1.0;
if ( d < 0 || e > 0) { discard; }
fCol = vColor;
fPos = vec4(0,0,0,0) ;
}
-76
View File
@@ -1,76 +0,0 @@
#version 450 core
layout (triangles) in;
layout (triangle_strip, max_vertices = 5) out;
in vec4 vColor[];
in vec2 vPosOff[];
in float vRadMag[];
out vec4 gColor;
out float wStart;
out float wEnd;
out vec3 gBoundingBox;
out vec2 box2 ;
vec2 normV2 (vec2 v)
{ return vec2(-v.y,v.x) ;
}
float lhs (vec2 da, vec2 db)
{ return sign(dot(da, normV2(db))) ;
}
float extrapolate (vec2 inOne, vec2 inZeroA, vec2 inZeroB, vec2 xy)
{
float det = inOne.x * (inZeroA.y - inZeroB.y)
+ inZeroA.x * (inZeroB.y - inOne.y)
+ inZeroB.x * (inOne.y - inZeroA.y)
;
float r = (inZeroA.y - inZeroB.y) ;
float s = (inZeroB.x - inZeroA.x) ;
float t = (inZeroA.x * inZeroB.y - inZeroB.x * inZeroA.y) ;
return r * xy.x + s * xy.y + t
/ det ;
}
void main()
{
vec3 pa = gl_in[0].gl_Position.xyz;
vec3 pb = gl_in[1].gl_Position.xyz;
vec3 pc = gl_in[2].gl_Position.xyz;
wStart = vRadMag [0];
wEnd = vRadMag [2];
box2 = vec2 (1,0);
gBoundingBox = vec3 (0.9,0.1,0);
gColor = vColor[0];
gl_Position = vec4 (vPosOff[0] , pa.z , 1);
EmitVertex();
box2 = vec2 (0,1);
gBoundingBox = vec3 (0.1,0.9,0);
gColor = vColor[2];
gl_Position = vec4 (vPosOff[2] , pc.z , 1);
EmitVertex();
box2 = vec2( extrapolate(vPosOff[0],vPosOff[2],pb.xy,pa.xy)
, extrapolate(vPosOff[2],vPosOff[0],pb.xy,pa.xy)
) ;
box2 = vec2(0.2,0);
gBoundingBox = vec3 (1,0,1);
gColor = vColor[0];
gl_Position = vec4 (pa, 1);
EmitVertex();
box2 = vec2( extrapolate(vPosOff[0],vPosOff[2],pb.xy,pc.xy)
, extrapolate(vPosOff[2],vPosOff[0],pb.xy,pc.xy)
) ;
box2 = vec2(0,0.2);
gBoundingBox = vec3 (0,1,1);
gColor = vColor[2];
gl_Position = vec4 (pc, 1);
EmitVertex();
box2 = vec2( 0,0 ) ;
gBoundingBox = vec3 (0,0,0);
gColor = vColor[1];
gl_Position = vec4 (pb, 1);
EmitVertex();
EndPrimitive();
}
-15
View File
@@ -1,15 +0,0 @@
#version 450 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec4 color;
layout (location = 2) in vec4 boxes;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vColor;
out vec2 boxOut;
out vec2 boxIn;
void main()
{
gl_Position = theMat * vec4(position.xyz,1);
vColor = color;
boxOut = boxes.xy ;
boxIn = boxes.zw ;
}
-11
View File
@@ -1,11 +0,0 @@
#version 450 core
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
uniform sampler2D aTexture;
in vec4 gColor;
in vec2 gTexCoord;
void main()
{
fCol = texture(aTexture, vec2 (gTexCoord.x * 0.0078125, gTexCoord.y)) * gColor;
fPos = vec4(0,0,0,0);
}
-35
View File
@@ -1,35 +0,0 @@
#version 450 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec4 vColor [];
in vec3 vTexCoord [];
out vec4 gColor;
out vec2 gTex;
void main()
{
vec3 cenPos = gl_in[0].gl_Position.xyz;
float sizex = vTexCoord[0].y;
float sizey = vTexCoord[0].z;
//float size = 0.05;
gColor = vColor[0];
float texPos = vTexCoord[0].x;
gl_Position = vec4 (cenPos.x - sizex*0.5, cenPos.y - sizey*0.5, cenPos.z , 1);
//gl_Position = vec4 (0, 0 , 5 , 1);
gTex = vec2 (texPos*0.0078125, 1);
EmitVertex();
gl_Position = vec4 (cenPos.x - sizex*0.5, cenPos.y + sizey*0.5, cenPos.z , 1);
//gl_Position = vec4 (0, 0.5 , 5 , 1);
gTex = vec2 (texPos*0.0078125, 0);
EmitVertex();
gl_Position = vec4 (cenPos.x + sizex*0.5, cenPos.y - sizey*0.5, cenPos.z , 1);
//gl_Position = vec4 (0.5, 0.5 , -5 , 1);
gTex = vec2 ((texPos+1)*0.0078125, 1);
EmitVertex();
gl_Position = vec4 (cenPos.x + sizex*0.5, cenPos.y + sizey*0.5, cenPos.z , 1);
gTex = vec2 ((texPos+1)*0.0078125, 0);
//gl_Position = vec4 (0.5, 0 , -5 , 1);
EmitVertex();
EndPrimitive();
}
-13
View File
@@ -1,13 +0,0 @@
#version 450 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec4 aColor;
layout (location = 2) in vec2 aTexCoord;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 gColor;
out vec2 gTexCoord;
void main()
{
gl_Position = theMat * vec4(aPos, 1.0);
gColor = aColor;
gTexCoord = aTexCoord;
}
-40
View File
@@ -1,40 +0,0 @@
#version 450 core
layout (triangles) in;
layout (triangle_strip, max_vertices = 4) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
in vec4 vCol[];
out vec4 gColC; // center color
out vec4 gColE; // edge color
out vec2 gBoundingBox;
out vec3 gPos;
void main()
{
vec4 pat = gl_in[0].gl_Position;
vec4 pbt = gl_in[1].gl_Position;
vec4 pct = gl_in[2].gl_Position;
vec4 pa = theMat * pat;
vec4 pb = theMat * pbt;
vec4 pc = theMat * pct;
gColC = vCol[0];
gColE = vCol[1];
gBoundingBox = vec2 (-1,1);
gl_Position = pb;
gPos = pbt.xyz;
EmitVertex();
gBoundingBox = vec2 (1,1);
gl_Position = pa;
gPos = pat.xyz;
EmitVertex();
gBoundingBox = vec2 (-1,-1);
gl_Position = pc;
gPos = pct.xyz;
EmitVertex();
gBoundingBox = vec2 (1,-1);
gl_Position = pa + pc - pb;
gPos = pat.xyz + pct.xyz - pbt.xyz;
EmitVertex();
EndPrimitive();
}
-11
View File
@@ -1,11 +0,0 @@
#version 450 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec4 col;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vCol;
void main()
{
//gl_Position = theMat * vec4(pos,1);
gl_Position = vec4(pos,1);
vCol = col;
}
+4 -4
View File
@@ -2,9 +2,8 @@
in vec4 vTexPosRot;
in vec2 vPos;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=1) out vec3 fPos;
layout (location=2) out vec4 normal;
//layout (binding=0) uniform sampler2DArray tilesetSampler;
layout (binding=40) uniform sampler2DArray diffuseSampler;
layout (binding=41) uniform sampler2DArray normalSampler;
vec2 rotateV2 (float a, vec2 v)
@@ -16,8 +15,9 @@ void main()
vec3 vTexPos = vTexPosRot.xyz;
float rot = vTexPosRot.w;
fCol = vec4(texture(diffuseSampler,vTexPos));
fPos = vec4(vPos,0,1);
fPos = vec3(vPos,0);
vec4 bn = vec4(texture(normalSampler,vTexPos) - 0.5);
vec3 nmap1 = vec3(rotateV2(rot,bn.xy), bn.z);
normal = vec4(-nmap1 ,0);
normal = vec4(-nmap1.xyz ,0);
//normal = vec4(0,0,-1 ,0);
}
+4 -4
View File
@@ -1,12 +1,12 @@
#version 450 core
layout (location = 0) in vec4 posXX;
layout (location = 1) in vec4 texPosRot;
struct PosTexRot {vec4 posXX; vec4 texPosRot; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 8) readonly buffer Data { PosTexRot data[]; };
out vec4 vTexPosRot;
out vec2 vPos;
void main()
{
vPos = posXX.xy;
vPos = data[gl_VertexID].posXX.xy;
gl_Position = theMat * vec4(vPos,0,1.0) ;
vTexPosRot = texPosRot;
vTexPosRot = data[gl_VertexID].texPosRot;
}
+18
View File
@@ -0,0 +1,18 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout(binding = 0) uniform sampler2D wincol;
layout(binding = 1) uniform sampler2D winpos;
layout(binding = 2) uniform sampler2D cloudcol;
layout(binding = 3) uniform sampler2D cloudpos;
vec4 blend (vec4 src, vec4 dst) {
return src + (1-src.a) * dst;
}
void main() {
//fColor = texture(t0, vTexPos) + texture(t2, vTexPos);
vec4 x = texture(wincol, vTexPos);
float xz = texture(winpos, vTexPos).z;
vec4 y = texture(cloudcol, vTexPos);
float yz = texture(cloudpos, vTexPos).z;
fColor = ( xz > yz ? blend(x,y) : blend(y,x)) ;
}
+7
View File
@@ -0,0 +1,7 @@
#version 450 core
layout (std140, binding = 2) uniform PosTex { vec4 posTex[6]; };
out vec2 vTexPos;
void main() {
gl_Position = vec4(posTex[gl_VertexID].xy,0,1);
vTexPos = posTex[gl_VertexID].zw;
}
-38
View File
@@ -1,38 +0,0 @@
#version 450 core
layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout(location=0)uniform vec3 lightPos;
in float drawbit[];
// the following code is duplicated in lineShadow.geom, should not be changed on its own
vec4 projNear (vec4 pos)
{
// note we project to a specific height
// this is quite brittle, not ideal
vec3 dir = pos.xyz - lightPos ;
float a = (100 - pos.z) / dir.z ;
vec2 xy = (pos.xyz + a * dir).xy ;
return vec4 ( xy, 100 , 1) ;
}
void main()
{
vec4 p0 = gl_in[0].gl_Position ;
vec4 p1 = gl_in[1].gl_Position ;
vec4 p2 = gl_in[2].gl_Position ;
if ( //if Light Source is below all vertices, draw cap
// TODO think about when LS is beside the object
(drawbit[0] == 1)
&& ( p0.z - lightPos.z > 0 )
&& ( p1.z - lightPos.z > 0 )
&& ( p2.z - lightPos.z > 0 )
)
{
// the front cap
vec4 v1 = vec4 (0,0,1,0) ;
gl_Position = theMat * projNear(p0); EmitVertex();
gl_Position = theMat * projNear(p2); EmitVertex();
gl_Position = theMat * projNear(p1); EmitVertex();
EndPrimitive();
}
else {}
}
+24 -7
View File
@@ -1,11 +1,28 @@
#version 450 core
layout (location = 0) in vec4 position;
struct PosColNorm { vec4 pos; vec4 dummy; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
uniform vec3 lightPos;
uniform vec4 lumRad;
out float drawbit;
void main()
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 lumRad; };
layout (std430, binding = 3) readonly buffer Data { PosColNorm data[]; };
layout (std430, binding = 4) readonly buffer Indices { uint indices[]; };
vec4 projNear (vec4 pos)
{
gl_Position = vec4(position.xyz,1);
drawbit = position.w;
// note we project to a specific height
// this is quite brittle, not ideal
vec3 dir = pos.xyz - lightPos.xyz ;
float a = (100 - pos.z) / dir.z ;
vec2 xy = (pos.xyz + a * dir).xy ;
return vec4 ( xy, 100 , 1) ;
}
bool ztest (vec4 p) {return p.z - lightPos.z > 0;}
void main() {
int j = gl_VertexID/3;
int i1 = j * 3;
vec4 po = data[indices[gl_VertexID]].pos;
gl_Position = (po.w == 1
&& ztest(data[indices[i1]].pos)
&& ztest(data[indices[i1+1]].pos)
&& ztest(data[indices[i1+2]].pos)
? theMat * projNear(po)
: vec4(1,1,1,0)
);
}
-57
View File
@@ -1,57 +0,0 @@
#version 450 core
// an attempt to test whether a geometry surface occludes the camera from a
// light source
layout (triangles) in;
layout (triangle_strip, max_vertices = 4) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
uniform vec3 lightPos;
uniform vec2 camPos;
void main()
{
vec3 p0 = gl_in[0].gl_Position.xyz ;
vec3 p1 = gl_in[1].gl_Position.xyz ;
vec3 p2 = gl_in[2].gl_Position.xyz ;
// first determine intersection point (if any)
vec3 u = p1 - p0 ;
vec3 v = p2 - p0 ;
vec3 n = cross (u,v) ;
vec3 dir = vec3 (camPos, 100) - lightPos ;
vec3 w0 = p0 - lightPos ;
float a = dot(n, w0) ;
float b = dot(n,dir) ;
if (abs(b) < 0.00001) {}
else {
float r = a / b ;
if (r < 0.0) {}
else {
vec3 ip = lightPos + r * dir ;
float uu, uv, vv, wu, wv, D;
uu = dot(u,u);
uv = dot(u,v);
vv = dot(v,v);
vec3 w = ip - p0;
wu = dot (w,u);
wv = dot (w,v);
D = uv * uv - uu * vv;
//get and test parametric coords
float s, t;
s = (uv * wv - vv * wu) / D;
if (s < 0.0 || s > 1.0) {}
else
{
t = (uv * wu - uu * wv) / D;
if (t < 0.0 || (s + t) > 1.0) {}
else
{
gl_Position = vec4(-1,-1,50,1); EmitVertex();
gl_Position = vec4(-1, 1,50,1); EmitVertex();
gl_Position = vec4( 1,-1,50,1); EmitVertex();
gl_Position = vec4( 1, 1,50,1); EmitVertex();
EndPrimitive();
}
}
}
}
}
+21
View File
@@ -0,0 +1,21 @@
#version 450 core
layout(early_fragment_tests) in;
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 lumRad; };
layout (binding = 0) uniform sampler2D posTexture;
layout (binding = 1) uniform sampler2D normals;
in vec2 vTexPos;
out vec4 fColor;
float rad = lumRad.a;
void main() {
vec3 pos = texture(posTexture, vTexPos).xyz;
vec3 distVec = pos - lightPos.xyz;
float dist = dot(distVec, distVec);
vec3 norm = texture(normals, vTexPos).xyz;
float y1 = dot(norm, distVec);
float y2 = float(y1 > 0 ? 1 : 0.2);
//bool t = pos.z > lightPos.z && norm.z > 0;
//float y2 = float(y1 > 0 || t ? 1 : 0.1);
float x = 1 - (pow(dist / rad,4));
vec3 c = y2* x * lumRad.rgb;
fColor = vec4(c, 0);
}
+8
View File
@@ -0,0 +1,8 @@
#version 450 core
layout (std140, binding = 2) uniform PosTex { vec4 posTex[6]; };
out vec2 vTexPos;
void main()
{
gl_Position = vec4(posTex[gl_VertexID].xy,0,1);
vTexPos = posTex[gl_VertexID].zw;
}
-27
View File
@@ -1,27 +0,0 @@
#version 450 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out float lum;
out vec2 dField;
void main()
{
lum = gl_in[0].gl_Position.w;
vec4 cenPos = vec4( gl_in[0].gl_Position.xy, 0.1 , 1);
float gRad = gl_in[0].gl_Position.z;
dField = vec2 ( 1, 1);
gl_Position = theMat * vec4 (cenPos.x + gRad, cenPos.y + gRad, 0.1 , 1);
EmitVertex();
dField = vec2 (-1, 1);
gl_Position = theMat * vec4 (cenPos.x - gRad, cenPos.y + gRad, 0.1 , 1);
EmitVertex();
dField = vec2 ( 1,-1);
gl_Position = theMat * vec4 (cenPos.x + gRad, cenPos.y - gRad, 0.1 , 1);
EmitVertex();
dField = vec2 (-1,-1);
gl_Position = theMat * vec4 (cenPos.x - gRad, cenPos.y - gRad, 0.1 , 1);
EmitVertex();
EndPrimitive();
}
-91
View File
@@ -1,91 +0,0 @@
#version 450 core
layout(lines_adjacency) in;
layout(triangle_strip, max_vertices = 4) out;
layout(std140, binding = 0) uniform TheMat { mat4 theMat; };
layout(location=0) uniform vec3 lightPos;
layout(location=1) uniform float radiusUniform;
// vec4 shift (vec4 p) { return (vec4 (p.xyz +
// (lumRad.a*normalize(p.xyz-lightPos)), 1));}
float closestPointOnLineParam3 (vec3 a, vec3 b, vec3 p) {
return dot(p - a,b-a) / dot(b-a,b-a);
}
vec3 closestPointOnSeg3 (vec3 a,vec3 b, vec3 p) {
float x = closestPointOnLineParam3(a,b,p);
if (x < 0) {
return a;
} else{ if (x > 1) { return b; }
{ return a + (x * (b- a));}
}
}
//vec3 closepoint =
vec4 shift(vec4 p) { return (vec4(p.xyz + (100000 * (p.xyz - lightPos)), 1)); }
vec4 shiftBy(float x, vec4 p) {
return (vec4(lightPos + (x * normalize(p.xyz - lightPos)), 1));
}
// vec4 shift (vec4 p) { return (vec4 (lightPos +
// (lumRad.a*normalize(p.xyz-lightPos)), 1));}
// copied from lighting/cap.geom, should not be changed on its own
vec4 projNear(vec4 pos) {
// note we project to a specific height
// this is quite brittle, not ideal
vec3 dir = pos.xyz - lightPos;
float a = (100 - pos.z) / dir.z;
vec2 xy = (pos.xyz + a * dir).xy;
return vec4(xy, 100, 1);
}
vec4 shiftNear(vec4 pos)
//{ vec4 sp = shiftBy(radiusUniform,pos);
{
vec4 sp = shift(pos);
if (sp.z > 100) {
return projNear(pos);
} else {
return sp;
}
}
vec4 f(vec4 p) { return (theMat * p); }
void main() {
vec4 p0 = gl_in[0].gl_Position;
vec4 p1 = gl_in[1].gl_Position;
vec3 closepoint = closestPointOnSeg3(p0.xyz,p1.xyz,lightPos);
float ru2 = radiusUniform * radiusUniform;
vec4 mid = 0.5 * (p0 + p1);
vec3 n0a = gl_in[2].gl_Position.xyz;
vec3 n1a = gl_in[3].gl_Position.xyz;
vec3 n0 = cross(p1.xyz - p0.xyz, n0a - p0.xyz);
vec3 n1 = cross(p0.xyz - p1.xyz, n1a - p1.xyz);
// vec3 n2 = n0 + n1; // assumes the summands are normalized
vec3 lightDir = p0.xyz - lightPos.xyz;
vec3 lightDir2 = p1.xyz - lightPos.xyz;
// first test if the edge is part of the silhouette
// that is, if the normals of the faces connected by the edge point are in
// "different directions" wrt the light direction
if (dot(n0, lightDir) * dot(n1, lightDir) <= 0 &&
(dot(lightDir, lightDir) < ru2 || dot(lightDir2, lightDir2) < ru2))
// using <= rather than < seems to get rid of overlapping shadow
// artefacts
{
//vec4 p2 = shiftNear(p0);
//vec4 p3 = shiftNear(p1);
vec4 p2 = shiftNear(p0);
vec4 p3 = shiftNear(p1);
gl_Position = f(p0);
EmitVertex();
if (dot(n0, lightDir) > 0) {
gl_Position = f(p2);
EmitVertex();
gl_Position = f(p1);
EmitVertex();
} else {
gl_Position = f(p1);
EmitVertex();
gl_Position = f(p2);
EmitVertex();
}
gl_Position = f(p3);
EmitVertex();
EndPrimitive();
} else {
}
}
+79 -2
View File
@@ -1,6 +1,83 @@
#version 450 core
layout (location = 0) in vec3 pos;
struct PosColNorm { vec4 pos; vec4 dummy; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 colrad; };
layout (std430, binding = 3) readonly buffer Data { PosColNorm data[]; };
layout (std430, binding = 5) readonly buffer Indices { uint indices[]; };
float closestPointOnLineParam3 (vec3 a, vec3 b, vec3 p) {
return dot(p - a,b-a) / dot(b-a,b-a);
}
vec3 closestPointOnSeg3 (vec3 a,vec3 b, vec3 p) {
float x = closestPointOnLineParam3(a,b,p);
return (x < 0
? a
: (x > 1
? b
: a + (x * (b- a)))) ;
}
vec4 shift(vec4 p) { return (vec4(p.xyz + (10000 * (p.xyz - lightPos.xyz)), 1)); }
vec4 shiftBy(float x, vec4 p) {
return (vec4(lightPos.xyz + (x * normalize(p.xyz - lightPos.xyz)), 1));
}
vec4 projNear (vec4 pos)
{
// note we project to a specific height
// this is quite brittle, not ideal
vec3 dir = pos.xyz - lightPos.xyz ;
float a = (100 - pos.z) / dir.z ;
vec2 xy = (pos.xyz + a * dir).xy ;
return vec4 ( xy, 100 , 1) ;
}
vec4 shiftNear(vec4 pos)
{
vec4 sp = shift(pos);
return (sp.z > 100 ? projNear(pos) : sp);
}
// Output 6 vertices for 4 data inputs
const int ks[6] = // Inputdata: n1a Shadow:
{0,1,2 // 2--3 / p2--p3
,2,1,3 // | | p0---p1 / |
}; // 0--1 / / |
// n0a p0----p1
void main()
{
gl_Position = vec4(pos,1);
int k = ks[gl_VertexID % 6];
int i0 = 4*(gl_VertexID / 6);
vec4 p0 = data[indices[i0]].pos;
vec4 p1 = data[indices[i0+1]].pos;
vec3 n0a = data[indices[i0+2]].pos.xyz;
vec3 n1a = data[indices[i0+3]].pos.xyz;
vec3 closepoint = closestPointOnSeg3(p0.xyz,p1.xyz,lightPos.xyz);
float ru2 = colrad.w * colrad.w;
vec4 mid = 0.5 * (p0 + p1);
vec3 n0 = cross(p1.xyz - p0.xyz, n0a - p0.xyz);
vec3 n1 = cross(p0.xyz - p1.xyz, n1a - p1.xyz);
vec3 lightDir = p0.xyz - lightPos.xyz;
vec3 lightDir2 = p1.xyz - lightPos.xyz;
// test if the edge is part of the silhouette
// that is, if the normals of the faces connected to the edge are in
// "different directions" wrt the light direction
// (first test the "drawbit")
//if (p0.w==1 && dot(n0, lightDir) * dot(n1, lightDir) <= 0 &&
if ( dot(n0, lightDir) * dot(n1, lightDir) <= 0 &&
(dot(lightDir, lightDir) < ru2 || dot(lightDir2, lightDir2) < ru2))
// using <= rather than < seems to get rid of overlapping shadow
// artefacts
{
vec4 p2 = shiftNear(p0);
vec4 p3 = shiftNear(p1);
if (dot(n0, lightDir) < 0)
{
vec4 sp[4] = {p1,p0,p3,p2};
gl_Position = theMat * sp[k];}
else {
vec4 ps[4] = {p0,p1,p2,p3};
gl_Position = theMat * ps[k]; }
}
else {gl_Position = vec4(1,1,1,0);}
}
//layout (location = 0) in vec3 pos;
//void main()
//{
// gl_Position = vec4(pos,1);
//}
+23 -22
View File
@@ -1,34 +1,35 @@
#version 450 core
layout(location=0)uniform vec3 lightPos;
layout(location=1)uniform vec4 lumRad;
layout (binding = 0) uniform sampler2D screenTexture;
layout(early_fragment_tests) in;
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 lumRad; };
layout (binding = 0) uniform sampler2D posTexture;
layout (binding = 1) uniform sampler2D normals;
in vec2 vTexPos;
out vec4 fColor;
float rad = lumRad.a;
void main() {
vec3 pos = texture(screenTexture, vTexPos).xyz;
vec3 distVec = pos - lightPos;
vec3 pos = texture(posTexture, vTexPos).xyz;
vec3 distVec = pos - lightPos.xyz;
float dist = dot(distVec, distVec);
if (dist > rad) {
discard;
}
vec4 normbit = texture(normals, vTexPos);
vec3 norm = normbit.xyz;
// float dist = dot(distVec.xy, distVec.xy);
// if (dist > rad) {
// discard;
// }
float t = texture(normals, vTexPos).w;
vec3 norm = texture(normals, vTexPos).xyz;
float y1 = dot(normalize(norm), normalize(distVec));
float y2 = float(y1 > 0 ? 1 : 0);
//float y3 = clamp(0.5 * (y1 + 1),0,1) ;
float y3 = clamp(2*y1 + 1,0,1) ;
//float y3 = clamp(0.5 * (y1 + 2),0,1) ;
//float y = float(normbit.w == 0 ? y3 : y2);
float y = y2;
//float x = 1 - dist / rad;
float x = 1 - (pow(dist / rad,4));
//float x = 1 ;
//float y2x = y2;
float y4 = float(y1 > 0 && y1 < 0.5 ? 0.5 : y2);
float y5 = max(0,y1);
//float y4 = smoothstep(-1,1,y1);
//float y4 = 0.25*pow(y1+1,2);
float y3 = float(t > 0
? y2
: (t == 0 ? y4 : y4));
//float x = 1 - (dist / rad);
//float x = 1;
//float x = 1 - max(0, ((dist + 10000) - rad) * 0.0001) ;
//vec3 c = y* (x * x * x) * lumRad.rgb;
vec3 c = y* x * lumRad.rgb;
//vec3 c = x * lumRad.rgb;
//float x = (dist > rad ? 0 : 1);
float x = 1 - (pow(dist / rad,4));
vec3 c = y3* x * lumRad.rgb;
fColor = vec4(c, 0);
}
+3 -4
View File
@@ -1,9 +1,8 @@
#version 450 core
layout (location = 0) in vec2 pos;
layout (location = 1) in vec2 texPos;
layout (std140, binding = 2) uniform PosTex { vec4 posTex[6]; };
out vec2 vTexPos;
void main()
{
gl_Position = vec4(pos,0,1);
vTexPos = texPos;
gl_Position = vec4(posTex[gl_VertexID].xy,0,1);
vTexPos = posTex[gl_VertexID].zw;
}
-68
View File
@@ -1,68 +0,0 @@
#version 450 core
layout(points) in;
layout(triangle_strip, max_vertices = 18) out;
layout(std140, binding = 0) uniform TheMat { mat4 theMat; };
layout(location=0) uniform vec3 lightPos;
layout(location=1) uniform float rad;
float rad2 = rad;
// Preprocessed to include ../functions.glsl
float closestPointOnLineParam (vec2 a, vec2 b, vec2 p) {
return dot(p - a,b-a) / dot(b-a,b-a);
}
vec2 closestPointOnSeg (vec2 a,vec2 b, vec2 p) {
float x = closestPointOnLineParam(a,b,p);
if (x < 0) {
return a;
} else{ if (x > 1) { return b; }
{ return a + (x * (b- a));}
}
}
// End include 2023-03-13 15:33:44.438312149 UTC
vec2 shift(vec2 p) {
return vec2(lightPos.xy + (rad2 * normalize(p - lightPos.xy)));
}
float isLHS(vec2 startV, vec2 testV) {
return sign(-startV.x * testV.y + startV.y * testV.x);
}
// construct a box with openings on bottom face and face away from wall
void main() {
vec2 p1 = gl_in[0].gl_Position.xy;
vec2 p2 = gl_in[0].gl_Position.zw;
vec2 closepoint = closestPointOnSeg(p1,p2,lightPos.xy);
if (isLHS(p1 - lightPos.xy, p2 - lightPos.xy) < 0 && distance(closepoint,lightPos.xy) < rad2) {
vec2 closeshift = (rad2 * normalize(closepoint - lightPos.xy)) + lightPos.xy - closepoint;
vec2 p1cs = p1 + closeshift;
vec2 p1o = vec2( distance(p1,lightPos.xy) > rad2 ? p1cs : shift(p1) );
vec2 p2cs = p2 + closeshift;
vec2 p2o = vec2( distance(p2,lightPos.xy) > rad2 ? p2cs : shift(p2) );
gl_Position = theMat * vec4(p1o,-500,1); EmitVertex();
gl_Position = theMat * vec4(p1,-500,1); EmitVertex();
gl_Position = theMat * vec4(p1o,100,1); EmitVertex();
gl_Position = theMat * vec4(p1,100,1); EmitVertex();
gl_Position = theMat * vec4(p1cs,100,1); EmitVertex();
gl_Position = theMat * vec4(p2,100,1); EmitVertex();
gl_Position = theMat * vec4(p2cs,100,1); EmitVertex();
gl_Position = theMat * vec4(p2o,100,1); EmitVertex();
EndPrimitive();
// gl_Position = theMat * vec4(p2o,100,1); EmitVertex();
// gl_Position = theMat * vec4(p2,100,1); EmitVertex();
// gl_Position = theMat * vec4(p2o,0,1); EmitVertex();
// gl_Position = theMat * vec4(p2,0,1); EmitVertex();
gl_Position = theMat * vec4(p2,100,1); EmitVertex();
gl_Position = theMat * vec4(p2,-500,1); EmitVertex();
gl_Position = theMat * vec4(p2o,100,1); EmitVertex();
gl_Position = theMat * vec4(p2o,-500,1); EmitVertex();
gl_Position = theMat * vec4(p2cs,100,1); EmitVertex();
gl_Position = theMat * vec4(p2cs,-500,1); EmitVertex();
gl_Position = theMat * vec4(p1cs,100,1); EmitVertex();
gl_Position = theMat * vec4(p1cs,-500,1); EmitVertex();
gl_Position = theMat * vec4(p1o,100,1); EmitVertex();
gl_Position = theMat * vec4(p1o,-500,1); EmitVertex();
EndPrimitive();
} else {
}
}
+32 -4
View File
@@ -1,6 +1,34 @@
#version 450 core
layout (location = 0) in vec4 poss;
void main()
{
gl_Position = poss;
struct PosTex { vec4 pospos; vec4 texang; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 colrad; };
layout (std430, binding = 2) readonly buffer Pos { PosTex data[]; };
float rad = colrad.w;
int indices[18] =
{5,7,1 // 6----7
,7,3,1 // /| /|
,7,6,3 // 2-+--3 |
,6,2,3 // | 4 | 5
,6,4,2 // 0 1
,4,0,2
};
vec2 shift(vec2 p) {
return vec2(lightPos.xy + (rad * normalize(p - lightPos.xy)));
}
float detV(vec2 p, vec2 q) {
return p.x*q.y - p.y*q.x;
}
float isLHS(vec2 p, vec2 q) {
return sign(-detV(p,q));
}
void main() {
vec4 pp = data[gl_VertexID / 18].pospos;
int j = indices[gl_VertexID % 18];
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
float z = ((j / 2) % 2 > 0.5 ? 100 : -500);
vec2 xyo = ( j > 3.5 ? shift(xy) : xy);
vec4 p = theMat * vec4(xyo,z,1);
gl_Position = (isLHS(pp.xy-lightPos.xy,pp.zw-lightPos.xy) < 0
? p
: vec4(1,1,1,0));
}
+15
View File
@@ -0,0 +1,15 @@
#version 450 core
struct PosColBox { vec4 pos; vec4 col; vec4 box; };
layout (std430, binding = 12) readonly buffer Data { PosColBox data[]; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (location = 0) uniform int layoff;
out vec4 vCol;
out vec3 vPos;
out vec3 vparams;
void main() {
vec4 p = data[gl_VertexID].pos;
gl_Position = theMat * p;
vCol = data[gl_VertexID].col;
vparams = data[gl_VertexID].box.xyz;
vPos = p.xyz;
}
+13
View File
@@ -0,0 +1,13 @@
#version 450 core
struct PosCol { vec4 pos; vec4 col; };
layout (std430, binding = 10) readonly buffer Data { PosCol data[]; };
layout (location = 0) uniform int layoff;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vCol;
out vec3 vPos;
void main() {
vec4 p = data[gl_VertexID].pos;
gl_Position = theMat * p;
vCol = data[gl_VertexID].col;
vPos = p.xyz;
}
+1 -3
View File
@@ -4,6 +4,4 @@ layout (binding=50) uniform sampler2DArray thetexture;
in vec4 vColor;
in vec3 vTexCoord;
void main()
{
fColor = texture(thetexture, vec3 (vTexCoord.xyz)) * vColor;
}
{ fColor = texture(thetexture, vec3 (vTexCoord.xyz)) * vColor; }
+7 -6
View File
@@ -1,13 +1,14 @@
#version 450 core
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec4 inColor;
layout (location = 2) in vec4 inTexCoord;
struct PosColTcoord { vec4 pos; vec4 col; vec4 tcoord; };
layout (std430, binding = 11) readonly buffer Data { PosColTcoord data[]; };
layout (location = 0) uniform int layoff;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vColor;
out vec3 vTexCoord;
void main()
{
gl_Position = theMat * vec4(inPos.xyz, 1.0);
vColor = inColor;
vTexCoord = inTexCoord.xyz;
vec4 p = data[gl_VertexID].pos;
gl_Position = theMat * p;
vColor = data[gl_VertexID].col;
vTexCoord = data[gl_VertexID].tcoord.xyz;
}
+33
View File
@@ -0,0 +1,33 @@
#version 450 core
struct PosCol { vec4 posx; vec4 colx; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 13) readonly buffer Data { PosCol data[]; };
layout (location = 0) uniform int n;
out vec4 gColC; // center color
out vec4 gColE; // edge color
out vec2 gBoundingBox;
out vec3 gPos;
const int ks[6] = //
{1,0,2 // 2--3
,2,0,3 // | |
}; // 1--0
//
const vec2 bs[4] =
{ vec2( 1, 1)
, vec2(-1, 1)
, vec2(-1,-1)
, vec2( 1,-1)
} ;
void main()
{
int i0 = n + (3 * ((gl_VertexID-n)/6) );
gColC = data[i0].colx;
gColE = data[i0+1].colx;
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
: data[i0+k].posx
).xyz;
gl_Position = theMat * vec4(gPos,1);
}
+20
View File
@@ -0,0 +1,20 @@
#version 450 core
in vec3 vPos;
in vec4 vCol;
in vec2 vControls;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=2) out vec4 fNorm;
void main()
{
float d = dot(vControls,vControls);
if (d > 1) {discard;}
// the following is an alternative without using discard
// not sure how this would interact with bloom
//float d = min(dot(vControls,vControls),1);
float a = vCol.w*(1-d);
fCol = vec4(vCol.xyz,a);
fPos = vec4(vPos, a);
//fNorm = vec4(-vControls, -0.1 + 0.2 * d ,fCol.w);
fNorm = vec4(-vControls, -0.1 + 0.3 * d ,a);
}
+24
View File
@@ -0,0 +1,24 @@
#version 450 core
struct CloudPosCol { vec3 pos; uint col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 6) readonly buffer CPos { CloudPosCol data[]; };
const vec2 indices[6] =
{vec2(-1,-1) // 0 2--3
,vec2( 1,-1) // 1 | |
,vec2( 1, 1) // 3 0--1
,vec2(-1,-1) // 0
,vec2(-1, 1) // 2
,vec2( 1, 1) // 3
};
out vec4 vCol;
out vec2 vControls;
out vec3 vPos;
void main()
{
uint i = gl_VertexID / 6;
uint k = gl_VertexID % 6;
vCol = unpackUnorm4x8(data[i].col);
vControls = indices[k];
vPos = vec3(data[i].pos.xy + 20*vControls, data[i].pos.z);
gl_Position = theMat * vec4(vPos,1);
}
+18
View File
@@ -0,0 +1,18 @@
#version 450 core
struct Verx { vec4 pos; vec4 col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 6) readonly buffer Pos { Verx data[]; };
int indices[6] = {0,1,3,0,3,2};
out vec4 vColC;
out vec4 vColE;
out vec4 vPos;
out vec2 vDist;
void main()
{
uint i0 = gl_VertexID / 6;
uint k = indices[gl_VertexID % 6];
vec4 br =
//gl_Position = theMat * vec4(pos,1);
gl_Position = vec4(pos,1);
vCol = col;
}
+19
View File
@@ -0,0 +1,19 @@
#version 450 core
layout (location=0) out vec4 fCol;
layout (location=1) out vec3 fPos;
layout (location=2) out vec4 fNorm;
in vec3 vTexCoords;
in vec4 vPos;
in float vAng;
layout (binding=40) uniform sampler2DArray diffuseSampler;
layout (binding=41) uniform sampler2DArray normalSampler;
vec2 rotateV2 (float a, vec2 v)
{ return vec2(v.x*cos(a) - v.y*sin(a), v.x*sin(a) + v.y*cos(a)); }
void main()
{
fCol = texture(diffuseSampler,vTexCoords);
fPos = vPos.xyz;
vec4 basenorm = texture(normalSampler,vTexCoords) - 0.5;
vec2 n1 = rotateV2(vAng,vec2(basenorm.x,basenorm.z));
fNorm = vec4(-vec3(n1,basenorm.y),0);
}
+22
View File
@@ -0,0 +1,22 @@
#version 450 core
struct PosTex { vec4 pospos; vec4 texang; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 2) readonly buffer Pos { PosTex data[]; };
out float vAng;
out vec4 vPos;
out vec3 vTexCoords;
int indices[6] = {0,1,3,0,3,2};
void main()
{
vec4 texang = data[gl_VertexID / 6].texang;
vec4 pp = data[gl_VertexID / 6].pospos;
int j = indices[gl_VertexID % 6];
float z = (j > 1.5 ? 100 : 0);
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
vPos = vec4( xy, z, 1);
gl_Position = theMat * vPos;
vAng = texang.y;
float d = distance(pp.xy,pp.zw) / 50;
int jj = j / 2;
vTexCoords = vec3(d * (j % 2), 2 * jj , texang.x);
}
+13
View File
@@ -0,0 +1,13 @@
#version 450 core
layout (location=0) out vec4 fColOverCloud;
layout (location=1) out vec4 fColUnderCloud;
layout(binding = 3) uniform sampler2D cloudpos;
in vec4 vCol;
in vec4 vPos;
in vec2 vScreenPos;
void main()
{
float cloudz = texture(cloudpos, vScreenPos).z;
fColOverCloud = ( cloudz > vPos.z ? vec4(0) : vCol);
fColUnderCloud = ( cloudz > vPos.z ? vCol : vec4(0));
}
+29
View File
@@ -0,0 +1,29 @@
#version 450 core
struct PosCol { vec4 pospos; vec4 col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 1) readonly buffer Pos { PosCol data[]; };
out vec4 vCol;
out vec4 vPos;
out vec2 vScreenPos;
int indices[6] =
{0,3,1
,0,2,3};
// note reversed compared to walls
void main()
{
vCol = data[gl_VertexID / 12].col;
vec4 pp = data[gl_VertexID / 12].pospos;
int j = indices[gl_VertexID % 6];
bool t = gl_VertexID % 12 > 5.5;
float z = (j > 1.5
? (t ? 100 : 5000)
: (t ? 0 : 100)
);
// we draw two quads: one which can be below clouds,
// and one which is always above
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
vPos = vec4( xy, z, 1);
gl_Position = theMat * vPos;
vScreenPos = 0.5 * (vec2(1) + vec2(gl_Position.x / gl_Position.w
,gl_Position.y / gl_Position.w));
}
+4 -3
View File
@@ -3,11 +3,12 @@ in vec4 vCol;
in vec4 vPos;
in vec4 vNorm;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=1) out vec3 fPos;
layout (location=2) out vec4 fNorm;
void main()
{
fCol = vCol;
fPos = vPos;
fNorm = vec4(vNorm.xyz - vPos.xyz,1);
fPos = vPos.xyz;
//fNorm = vec4(vNorm.xyz,1);
fNorm = vNorm;
}
+7 -7
View File
@@ -1,14 +1,14 @@
#version 450 core
layout (location = 0) in vec4 pos;
layout (location = 1) in vec4 col;
layout (location = 2) in vec4 norm;
struct PosColNorm { vec4 pos; uint norm; uint col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 3) readonly buffer Data { PosColNorm data[]; };
layout (std430, binding = 4) readonly buffer Indices { uint indices[]; };
out vec4 vCol;
out vec4 vPos;
out vec4 vNorm;
void main() {
gl_Position = theMat * vec4(pos.xyz,1);
vCol = col;
vPos = pos;
vNorm = norm;
vPos = data[indices[gl_VertexID]].pos;
vCol = unpackUnorm4x8(data[indices[gl_VertexID]].col);
vNorm = unpackSnorm4x8(data[indices[gl_VertexID]].norm);
gl_Position = theMat * vec4(vPos.xyz,1);
}
+105
View File
@@ -0,0 +1,105 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout (location = 0) uniform vec2 screensize;
layout(binding = 0) uniform sampler2D screenTexture;
vec3 f (float x, float y)
//{ return texture(screenTexture, vTexPos + vec2((x+0.5)/screensize.x,(y+0.5)/screensize.y)).xyz;
{ return texture(screenTexture, vTexPos + vec2(x/screensize.x,y/screensize.y)).xyz;
}
bool t (vec3 x, vec3 y)
{ return dot(x-y,x-y) < 0.005;
}
bool t3 (vec3 x, vec3 y, vec3 z)
{ return t(x,y) && t(y,z);
}
vec3 c = f(0,0);
bool bt (vec3 x, vec3 y)
{ return x.x+x.y+x.z > y.x+y.y+y.z;}
bool t4 (vec3 x, vec3 y, vec3 z)
{ return t(x,z) && (t(x,y) || bt(x,c)) ; }
bool incenter (int x) { return x > 0 && x < 3; }
int three = int(( floor(vTexPos.y * screensize.y))) % 3;
int i = int(( floor(vTexPos.x * screensize.x))) % 4;
int j = int(( floor(vTexPos.y * screensize.y))) % 4;
vec4 edgecase (vec3 e1, vec3 e2)
{ return vec4((t(e1,e2) && bt(e1,c) ? e1 : c),1); }
vec4 ttlcase (vec3 tt, vec3 tr, vec3 mr, vec3 br, vec3 bb, vec3 bl, vec3 ml, vec3 tl)
{
if (t(tl,tt) && t(tl,mr))
{return vec4(tl,1);}
if (t(tl,tt) && t(tl,ml))
{return vec4(tt,1);}
// if (t(tt,mr) && bt(tt,c))
// {return vec4(tt,1);}
return vec4(c,1);
}
vec4 corncase (vec3 e1, vec3 e2, vec3 corn)
{ return vec4( (t(e1,e2) && false == (t(corn,c)) ? e1 : c) , 1);}
//{ return vec4( (t(e1,e2) ? e1 : c) , 1);}
void main()
{
vec3 tl = f(-4, 4);
vec3 tt = f( 0, 4);
vec3 tr = f( 4, 4);
vec3 mr = f( 4, 0);
vec3 br = f( 4,-4);
vec3 bb = f( 0,-4);
vec3 bl = f(-4,-4);
vec3 ml = f(-4, 0);
vec3 tlc = f(-1, 1);
vec3 trc = f( 1, 1);
vec3 brc = f( 1,-1);
vec3 blc = f(-1,-1);
// if (t4(tl,tr,br))
// { fColor = vec4(tl,1);}
// else if (t4(tr,br,bl))
// { fColor = vec4(tr,1);}
// else if (t4(br,bl,tl))
// { fColor = vec4(br,1);}
// else if (t4(bl,tl,tr))
// { fColor = vec4(bl,1);}
if (incenter(i) && incenter(j))
{fColor = vec4(c,1); }
else
{ fColor = vec4(0,0,0,1);
switch (i * 10 + j) {
case 10:
fColor = ttlcase(bb,br,mr,tr,tt,tl,ml,bl);
break;
case 01:
fColor = ttlcase(ml,tl,tt,tr,mr,br,bb,bl);
break;
case 13:
fColor = ttlcase(tt,tr,mr,br,bb,bl,ml,tl);
break;
case 02:
fColor = ttlcase(ml,bl,bb,br,mr,tr,tt,tl);
break;
case 23:
fColor = ttlcase(tt,tl,ml,bl,bb,br,mr,tr);
break;
case 32:
fColor = ttlcase(mr,br,bb,bl,ml,tl,tt,tr);
break;
case 20:
fColor = ttlcase(bb,bl,ml,tl,tt,tr,mr,br);
break;
case 31:
fColor = ttlcase(mr,tr,tt,tl,ml,bl,bb,br);
break;
case 00:
fColor = corncase(ml,bb,bl);
break;
case 03:
fColor = corncase(ml,tt,tl);
break;
case 33:
fColor = corncase(mr,tt,tr);
break;
case 30:
fColor = corncase(mr,bb,br);
break;
}
}
}
+7
View File
@@ -0,0 +1,7 @@
#version 450 core
layout (std140, binding = 2) uniform PosTex { vec4 posTex[3]; };
out vec2 vTexPos;
void main() {
gl_Position = vec4(posTex[gl_VertexID].xy,0,1);
vTexPos = posTex[gl_VertexID].zw ;
}
+37
View File
@@ -0,0 +1,37 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout (location = 0) uniform vec2 screensize;
layout(binding = 0) uniform sampler2D screenTexture;
vec3 f (float x, float y)
//{ return texture(screenTexture, vTexPos + vec2((x+0.5)/screensize.x,(y+0.5)/screensize.y)).xyz;
{ return texture(screenTexture, vTexPos + vec2(x/screensize.x,y/screensize.y)).xyz;
}
bool t (vec3 x, vec3 y)
{ return dot(x-y,x-y) < 0.005;
}
bool t3 (vec3 x, vec3 y, vec3 z)
{ return t(x,y) && t(y,z);
}
void main()
{
vec3 tl = f(-1, 1);
vec3 tt = f( 0, 2);
vec3 tr = f( 1, 1);
vec3 mr = f( 2, 0);
vec3 br = f( 1,-1);
vec3 bb = f( 0,-2);
vec3 bl = f(-1,-1);
vec3 ml = f(-2, 0);
if (t3(tl,tr,br))
{ fColor = vec4(tr,1);}
else if (t3(tr,br,bl))
{ fColor = vec4(br,1);}
else if (t3(br,bl,tl))
{ fColor = vec4(bl,1);}
else if (t3(bl,tl,tr))
{ fColor = vec4(tl,1);}
else
//{fColor = texture(screenTexture, vTexPos); }
{fColor = vec4(f(0,0),1); }
}
+47
View File
@@ -0,0 +1,47 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout (location = 0) uniform vec2 screensize;
layout(binding = 0) uniform sampler2D screenTexture;
vec3 f (float x, float y)
//{ return texture(screenTexture, vTexPos + vec2((x+0.5)/screensize.x,(y+0.5)/screensize.y)).xyz;
{ return texture(screenTexture, vTexPos + vec2(x/screensize.x,y/screensize.y)).xyz;
}
bool t (vec3 x, vec3 y)
{ return dot(x-y,x-y) < 0.005;
}
bool t3 (vec3 x, vec3 y, vec3 z)
{ return t(x,y) && t(y,z);
}
vec3 c = f(0,0);
bool bt (vec3 x, vec3 y)
{ return x.x+x.y+x.z > y.x+y.y+y.z;}
bool t4 (vec3 x, vec3 y, vec3 z)
{ return t(x,z) && (t(x,y) || bt(x,c)) ;
}
void main()
{
vec3 tl = f(-2, 2);
vec3 tt = f( 0, 2);
vec3 tr = f( 2, 2);
vec3 mr = f( 2, 0);
vec3 br = f( 2,-2);
vec3 bb = f( 0,-2);
vec3 bl = f(-2,-2);
vec3 ml = f(-2, 0);
vec3 tlc = f(-1, 1);
vec3 trc = f( 1, 1);
vec3 brc = f( 1,-1);
vec3 blc = f(-1,-1);
if (t4(tl,tr,br))
{ fColor = vec4(tl,1);}
else if (t4(tr,br,bl))
{ fColor = vec4(tr,1);}
else if (t4(br,bl,tl))
{ fColor = vec4(br,1);}
else if (t4(bl,tl,tr))
{ fColor = vec4(bl,1);}
else
//{fColor = texture(screenTexture, vTexPos); }
{fColor = vec4(c,1); }
}
+105
View File
@@ -0,0 +1,105 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout (location = 0) uniform vec2 screensize;
layout(binding = 0) uniform sampler2D screenTexture;
vec3 f (float x, float y)
//{ return texture(screenTexture, vTexPos + vec2((x+0.5)/screensize.x,(y+0.5)/screensize.y)).xyz;
{ return texture(screenTexture, vTexPos + vec2(x/screensize.x,y/screensize.y)).xyz;
}
bool t (vec3 x, vec3 y)
{ return dot(x-y,x-y) < 0.005;
}
bool t3 (vec3 x, vec3 y, vec3 z)
{ return t(x,y) && t(y,z);
}
vec3 c = f(0,0);
bool bt (vec3 x, vec3 y)
{ return x.x+x.y+x.z > y.x+y.y+y.z;}
bool t4 (vec3 x, vec3 y, vec3 z)
{ return t(x,z) && (t(x,y) || bt(x,c)) ; }
bool incenter (int x) { return x > 0 && x < 3; }
int three = int(( floor(vTexPos.y * screensize.y))) % 3;
int i = int(( floor(vTexPos.x * screensize.x))) % 4;
int j = int(( floor(vTexPos.y * screensize.y))) % 4;
vec4 edgecase (vec3 e1, vec3 e2)
{ return vec4((t(e1,e2) && bt(e1,c) ? e1 : c),1); }
vec4 ttlcase (vec3 tt, vec3 tr, vec3 mr, vec3 br, vec3 bb, vec3 bl, vec3 ml, vec3 tl)
{
if (t(tl,tt) && t(tl,mr))
{return vec4(tl,1);}
if (t(tl,tt) && t(tl,ml))
{return vec4(tt,1);}
// if (t(tt,mr) && bt(tt,c))
// {return vec4(tt,1);}
return vec4(c,1);
}
vec4 corncase (vec3 e1, vec3 e2, vec3 corn)
{ return vec4( (t(e1,e2) && false == (t(corn,c)) ? e1 : c) , 1);}
//{ return vec4( (t(e1,e2) ? e1 : c) , 1);}
void main()
{
vec3 tl = f(-4, 4);
vec3 tt = f( 0, 4);
vec3 tr = f( 4, 4);
vec3 mr = f( 4, 0);
vec3 br = f( 4,-4);
vec3 bb = f( 0,-4);
vec3 bl = f(-4,-4);
vec3 ml = f(-4, 0);
vec3 tlc = f(-1, 1);
vec3 trc = f( 1, 1);
vec3 brc = f( 1,-1);
vec3 blc = f(-1,-1);
// if (t4(tl,tr,br))
// { fColor = vec4(tl,1);}
// else if (t4(tr,br,bl))
// { fColor = vec4(tr,1);}
// else if (t4(br,bl,tl))
// { fColor = vec4(br,1);}
// else if (t4(bl,tl,tr))
// { fColor = vec4(bl,1);}
if (incenter(i) && incenter(j))
{fColor = vec4(c,1); }
else
{ fColor = vec4(0,0,0,1);
switch (i * 10 + j) {
case 10:
fColor = ttlcase(bb,br,mr,tr,tt,tl,ml,bl);
break;
case 01:
fColor = ttlcase(ml,tl,tt,tr,mr,br,bb,bl);
break;
case 13:
fColor = ttlcase(tt,tr,mr,br,bb,bl,ml,tl);
break;
case 02:
fColor = ttlcase(ml,bl,bb,br,mr,tr,tt,tl);
break;
case 23:
fColor = ttlcase(tt,tl,ml,bl,bb,br,mr,tr);
break;
case 32:
fColor = ttlcase(mr,br,bb,bl,ml,tl,tt,tr);
break;
case 20:
fColor = ttlcase(bb,bl,ml,tl,tt,tr,mr,br);
break;
case 31:
fColor = ttlcase(mr,tr,tt,tl,ml,bl,bb,br);
break;
case 00:
fColor = corncase(ml,bb,bl);
break;
case 03:
fColor = corncase(ml,tt,tl);
break;
case 33:
fColor = corncase(mr,tt,tr);
break;
case 30:
fColor = corncase(mr,bb,br);
break;
}
}
}
-16
View File
@@ -1,16 +0,0 @@
#version 450 core
in vec3 vTexPos;
in vec3 vPos;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=2) out vec4 normal;
//layout (binding=0) uniform sampler2DArray tilesetSampler;
layout (binding=1) uniform sampler2D normalSampler;
void main()
{
//fCol = texture(tilesetSampler, vec3(0.3,0.1,0) + vTexPos);
fCol = vec4(0.2,0.3,0.6,1);
//fCol = vec4(0.6,0.4,0.3,1);
fPos = vec4(vPos,1);
normal = vec4(vPos + vec3(0.5) - texture(normalSampler,2*vTexPos.xy).xyz,0);
}
-12
View File
@@ -1,12 +0,0 @@
#version 450 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec3 texPos;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec3 vTexPos;
out vec3 vPos;
void main()
{
gl_Position = theMat * vec4(pos,1.0) ;
vTexPos = texPos;
vPos = pos;
}
+39 -10
View File
@@ -1,18 +1,47 @@
#version 450 core
in vec2 texPos;
in vec2 texDist;
in float gfactor;
in vec2 vcpos;
const int n1 = 15;
in vec2 distmask[n1];
in vec2 pinchr[n1];
in vec2 pinchg[n1];
in vec2 pinchb[n1];
out vec4 fColor;
layout (binding = 1) uniform sampler2D screenTexture;
float f ( float x) {
if (x>1) {return 1;} else {return (1-gfactor)*x + gfactor;}
layout (location = 0) uniform int n;
vec3 toYUV (vec3 rgb)
{ return rgb * mat3
( 0.299 , 0.587 , 0.114
,-0.14713,-0.28886, 0.436
, 0.615 ,-0.51499,-0.10001
) ;
}
vec3 toRGB (vec3 yuv)
{ return yuv * mat3
(1, 0 , 1.13983
,1,-0.39465,-0.58060
,1, 2.03211, 0
) ;
}
void main()
{
float t = f(length(texDist));
fColor = vec4(texture(screenTexture
, 0.5+0.5 *( vcpos + t * (texPos - vcpos))
)
);
vec2 tposr = texPos;
vec2 tposb = texPos;
vec2 tposg = texPos;
for(int i = 0; i < n; ++i)
{
float x = 1 - min(1, sqrt(distance(distmask[i],vec2(0,0))));
tposr += x * pinchr[i];
tposg += x * pinchg[i];
tposb += x * pinchb[i];
}
fColor.r = texture(screenTexture, tposr).r;
fColor.g = texture(screenTexture, tposg).g;
fColor.b = texture(screenTexture, tposb).b;
}
// fColor = vec4
// ( toRGB(vec3( toYUV(texture(screenTexture, texPos).rgb).r
// , toYUV(texture(screenTexture, (texPos + x*pinch)).rgb).g
// , toYUV(texture(screenTexture, (texPos + x*(pinch))).rgb).b
// ) )
// , 1
// ) ;
-44
View File
@@ -1,44 +0,0 @@
#version 450 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec2 vRad1[];
in vec2 vRad2[];
in vec2 vCen[];
in float vFactor[];
out vec2 vcpos;
out vec2 texPos;
out vec2 texDist;
out float gfactor;
vec2 g(float x,float y, vec2 v, vec2 r1, vec2 r2)
{ return vec2
(dot(normalize(r1-v),vec2(x,y)-v) / length(r1-v)
,dot(normalize(r2-v),vec2(x,y)-v) / length(r2-v)
);
}
void main() {
vec2 cpos = vCen[0];
vcpos = cpos;
vec2 grad1 = vRad1[0];
vec2 grad2 = vRad2[0];
gfactor = vFactor[0];
texPos = vec2(1,1);
texDist = g(1,1,cpos,grad1,grad2);
gl_Position = vec4 (1,1,0,1);
EmitVertex();
texPos = vec2(1,0);
texPos = vec2(1,-1);
texDist = g(1,-1,cpos,grad1,grad2);
gl_Position = vec4 (1,-1,0,1);
EmitVertex();
texPos = vec2(0,1);
texPos = vec2(-1,1);
texDist = g(-1,1,cpos,grad1,grad2);
gl_Position = vec4 (-1,1,0,1);
EmitVertex();
texPos = vec2(0,0);
texPos = vec2(-1,-1);
texDist = g(-1,-1,cpos,grad1,grad2);
gl_Position = vec4 (-1,-1,0,1);
EmitVertex();
EndPrimitive();
}

Some files were not shown because too many files have changed in this diff Show More