diff --git a/Bulb.resource_order b/Bulb.resource_order new file mode 100644 index 0000000..a83bd83 --- /dev/null +++ b/Bulb.resource_order @@ -0,0 +1,96 @@ +{ + "FolderOrderSettings":[ + {"name":"(System)","order":2,"path":"folders/Bulb/(System).yy",}, + {"name":"Renderer Definitions","order":7,"path":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy",}, + {"name":"Shaders","order":8,"path":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy",}, + {"name":"Kawase","order":11,"path":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Kawase.yy",}, + {"name":"Light","order":10,"path":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Light.yy",}, + {"name":"Shadow","order":9,"path":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Shadow.yy",}, + {"name":"Tonemapping","order":8,"path":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy",}, + {"name":"Normal Map","order":15,"path":"folders/Bulb/Normal Map.yy",}, + ], + "ResourceOrderSettings":[ + {"name":"oAmbientUnderlay","order":8,"path":"objects/oAmbientUnderlay/oAmbientUnderlay.yy",}, + {"name":"oDynamicOccluder","order":3,"path":"objects/oDynamicOccluder/oDynamicOccluder.yy",}, + {"name":"oDynamicOccluder3","order":3,"path":"objects/oDynamicOccluder3/oDynamicOccluder3.yy",}, + {"name":"oEmissive","order":9,"path":"objects/oEmissive/oEmissive.yy",}, + {"name":"oInit","order":1,"path":"objects/oInit/oInit.yy",}, + {"name":"oLightDiscoooo","order":4,"path":"objects/oLightDiscoooo/oLightDiscoooo.yy",}, + {"name":"oLightDiscoooo3","order":4,"path":"objects/oLightDiscoooo3/oLightDiscoooo3.yy",}, + {"name":"oLightPlasma","order":5,"path":"objects/oLightPlasma/oLightPlasma.yy",}, + {"name":"oPlayer","order":1,"path":"objects/oPlayer/oPlayer.yy",}, + {"name":"oPlayer3","order":1,"path":"objects/oPlayer3/oPlayer3.yy",}, + {"name":"oPyramid","order":10,"path":"objects/oPyramid/oPyramid.yy",}, + {"name":"oRendererPar","order":8,"path":"objects/oRendererPar/oRendererPar.yy",}, + {"name":"oShadowOverlay","order":7,"path":"objects/oShadowOverlay/oShadowOverlay.yy",}, + {"name":"oStaticOccluder","order":2,"path":"objects/oStaticOccluder/oStaticOccluder.yy",}, + {"name":"oStaticOccluder3","order":2,"path":"objects/oStaticOccluder3/oStaticOccluder3.yy",}, + {"name":"oSunlight","order":6,"path":"objects/oSunlight/oSunlight.yy",}, + {"name":"rmTest","order":1,"path":"rooms/rmTest/rmTest.yy",}, + {"name":"rmTestSoft","order":2,"path":"rooms/rmTestSoft/rmTestSoft.yy",}, + {"name":"rmTestWithGroups","order":3,"path":"rooms/rmTestWithGroups/rmTestWithGroups.yy",}, + {"name":"__BulbAddOcclusionHard","order":4,"path":"scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.yy",}, + {"name":"__BulbAddOcclusionSoft","order":5,"path":"scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.yy",}, + {"name":"__BulbConstants","order":1,"path":"scripts/__BulbConstants/__BulbConstants.yy",}, + {"name":"__BulbError","order":2,"path":"scripts/__BulbError/__BulbError.yy",}, + {"name":"__BulbRectInRect","order":3,"path":"scripts/__BulbRectInRect/__BulbRectInRect.yy",}, + {"name":"__BulbRendererDefineAccumulateHard","order":6,"path":"scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.yy",}, + {"name":"__BulbRendererDefineAccumulateSoft","order":5,"path":"scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.yy",}, + {"name":"__BulbRendererDefineLight","order":4,"path":"scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.yy",}, + {"name":"__BulbRendererDefineNormal","order":1,"path":"scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.yy",}, + {"name":"__BulbRendererDefineOverlayUnderlay","order":2,"path":"scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.yy",}, + {"name":"__BulbRendererDefineVertexBuffers","order":3,"path":"scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.yy",}, + {"name":"__BulbTrace","order":1,"path":"scripts/__BulbTrace/__BulbTrace.yy",}, + {"name":"BulbAmbienceSprite","order":8,"path":"scripts/BulbAmbienceSprite/BulbAmbienceSprite.yy",}, + {"name":"BulbDrawLitApplicationSurface","order":11,"path":"scripts/BulbDrawLitApplicationSurface/BulbDrawLitApplicationSurface.yy",}, + {"name":"BulbDynamicOccluder","order":6,"path":"scripts/BulbDynamicOccluder/BulbDynamicOccluder.yy",}, + {"name":"BulbLight","order":4,"path":"scripts/BulbLight/BulbLight.yy",}, + {"name":"BulbLightOverlay","order":10,"path":"scripts/BulbLightOverlay/BulbLightOverlay.yy",}, + {"name":"BulbNormalMapClear","order":3,"path":"scripts/BulbNormalMapClear/BulbNormalMapClear.yy",}, + {"name":"BulbNormalMapDrawSelf","order":5,"path":"scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.yy",}, + {"name":"BulbNormalMapDrawSprite","order":4,"path":"scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.yy",}, + {"name":"BulbNormalMapDrawSpriteExt","order":6,"path":"scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.yy",}, + {"name":"BulbNormalMapShaderReset","order":1,"path":"scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.yy",}, + {"name":"BulbRenderer","order":3,"path":"scripts/BulbRenderer/BulbRenderer.yy",}, + {"name":"BulbShadowOverlay","order":9,"path":"scripts/BulbShadowOverlay/BulbShadowOverlay.yy",}, + {"name":"BulbStaticOccluder","order":7,"path":"scripts/BulbStaticOccluder/BulbStaticOccluder.yy",}, + {"name":"BulbSunlight","order":5,"path":"scripts/BulbSunlight/BulbSunlight.yy",}, + {"name":"DebugOverlay","order":6,"path":"scripts/DebugOverlay/DebugOverlay.yy",}, + {"name":"VertexCake","order":5,"path":"scripts/VertexCake/VertexCake.yy",}, + {"name":"__shdBulbGammaToLinear","order":2,"path":"shaders/__shdBulbGammaToLinear/__shdBulbGammaToLinear.yy",}, + {"name":"__shdBulbHardShadowsSunlight","order":1,"path":"shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy",}, + {"name":"__shdBulbKawaseDown","order":1,"path":"shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.yy",}, + {"name":"__shdBulbKawaseUp","order":2,"path":"shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.yy",}, + {"name":"__shdBulbLightWithNormalMap","order":1,"path":"shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.yy",}, + {"name":"__shdBulbLinearToGamma","order":3,"path":"shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.yy",}, + {"name":"__shdBulbNormal","order":5,"path":"shaders/__shdBulbNormal/__shdBulbNormal.yy",}, + {"name":"__shdBulbNormalUp","order":6,"path":"shaders/__shdBulbNormalUp/__shdBulbNormalUp.yy",}, + {"name":"__shdBulbSoftShadows","order":2,"path":"shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy",}, + {"name":"__shdBulbSoftShadowsSunlight","order":3,"path":"shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy",}, + {"name":"__shdBulbSunlightWithNormalMap","order":3,"path":"shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.yy",}, + {"name":"__shdBulbSunlightWithoutNormalMap","order":2,"path":"shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.yy",}, + {"name":"__shdBulbThreshold","order":1,"path":"shaders/__shdBulbThreshold/__shdBulbThreshold.yy",}, + {"name":"__shdBulbTonemapACES","order":4,"path":"shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.yy",}, + {"name":"__shdBulbTonemapClamp","order":1,"path":"shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.yy",}, + {"name":"__shdBulbTonemapHBD","order":7,"path":"shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.yy",}, + {"name":"__shdBulbTonemapReinhard","order":2,"path":"shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.yy",}, + {"name":"__shdBulbTonemapReinhardExtended","order":3,"path":"shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.yy",}, + {"name":"__shdBulbTonemapUncharted2","order":5,"path":"shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.yy",}, + {"name":"__shdBulbTonemapUnreal3","order":6,"path":"shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.yy",}, + {"name":"shdPremultiplyAlpha","order":7,"path":"shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy",}, + {"name":"__sprBulbPixel","order":6,"path":"sprites/__sprBulbPixel/__sprBulbPixel.yy",}, + {"name":"sDynamicBlock","order":1,"path":"sprites/sDynamicBlock/sDynamicBlock.yy",}, + {"name":"sEmissive","order":10,"path":"sprites/sEmissive/sEmissive.yy",}, + {"name":"sFloorNormal","order":14,"path":"sprites/sFloorNormal/sFloorNormal.yy",}, + {"name":"sFloorTexture","order":13,"path":"sprites/sFloorTexture/sFloorTexture.yy",}, + {"name":"sLight1024","order":3,"path":"sprites/sLight1024/sLight1024.yy",}, + {"name":"sLight128","order":5,"path":"sprites/sLight128/sLight128.yy",}, + {"name":"sLight512","order":4,"path":"sprites/sLight512/sLight512.yy",}, + {"name":"sLightDebug","order":8,"path":"sprites/sLightDebug/sLightDebug.yy",}, + {"name":"sLightMask","order":7,"path":"sprites/sLightMask/sLightMask.yy",}, + {"name":"sLightTorch","order":6,"path":"sprites/sLightTorch/sLightTorch.yy",}, + {"name":"sPlayerMask","order":9,"path":"sprites/sPlayerMask/sPlayerMask.yy",}, + {"name":"sPyramid","order":12,"path":"sprites/sPyramid/sPyramid.yy",}, + {"name":"sPyramidNormal","order":11,"path":"sprites/sPyramidNormal/sPyramidNormal.yy",}, + ], +} \ No newline at end of file diff --git a/Bulb.yyp b/Bulb.yyp index 0c2a5e3..e804363 100644 --- a/Bulb.yyp +++ b/Bulb.yyp @@ -3,70 +3,125 @@ "resourceVersion": "1.6", "name": "Bulb", "resources": [ - {"id":{"name":"BulbLight","path":"scripts/BulbLight/BulbLight.yy",},"order":3,}, - {"id":{"name":"sStaticBlock","path":"sprites/sStaticBlock/sStaticBlock.yy",},"order":0,}, - {"id":{"name":"sDynamicBlock","path":"sprites/sDynamicBlock/sDynamicBlock.yy",},"order":1,}, - {"id":{"name":"sLight512","path":"sprites/sLight512/sLight512.yy",},"order":3,}, - {"id":{"name":"sLight128","path":"sprites/sLight128/sLight128.yy",},"order":4,}, - {"id":{"name":"sLightTorch","path":"sprites/sLightTorch/sLightTorch.yy",},"order":5,}, - {"id":{"name":"BulbDynamicOccluder","path":"scripts/BulbDynamicOccluder/BulbDynamicOccluder.yy",},"order":5,}, - {"id":{"name":"__shdBulbFinalRender","path":"shaders/__shdBulbFinalRender/__shdBulbFinalRender.yy",},"order":9,}, - {"id":{"name":"sLightMask","path":"sprites/sLightMask/sLightMask.yy",},"order":6,}, - {"id":{"name":"__BulbSystem","path":"scripts/__BulbSystem/__BulbSystem.yy",},"order":0,}, - {"id":{"name":"rmTest","path":"rooms/rmTest/rmTest.yy",},"order":1,}, - {"id":{"name":"BulbLightOverlay","path":"scripts/BulbLightOverlay/BulbLightOverlay.yy",},"order":9,}, - {"id":{"name":"__sprBulbPixel","path":"sprites/__sprBulbPixel/__sprBulbPixel.yy",},"order":11,}, - {"id":{"name":"sLightDebug","path":"sprites/sLightDebug/sLightDebug.yy",},"order":7,}, - {"id":{"name":"__shdBulbSoftShadowsSunlight","path":"shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy",},"order":6,}, - {"id":{"name":"oLightDiscoooo3","path":"objects/oLightDiscoooo3/oLightDiscoooo3.yy",},"order":4,}, - {"id":{"name":"sPlayerMask","path":"sprites/sPlayerMask/sPlayerMask.yy",},"order":8,}, - {"id":{"name":"DebugOverlay","path":"scripts/DebugOverlay/DebugOverlay.yy",},"order":6,}, - {"id":{"name":"oPlayer3","path":"objects/oPlayer3/oPlayer3.yy",},"order":1,}, - {"id":{"name":"__BulbAddOcclusionHard","path":"scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.yy",},"order":1,}, - {"id":{"name":"VertexCake","path":"scripts/VertexCake/VertexCake.yy",},"order":5,}, - {"id":{"name":"__BulbConfig","path":"scripts/__BulbConfig/__BulbConfig.yy",},"order":0,}, + {"id":{"name":"oAmbientUnderlay","path":"objects/oAmbientUnderlay/oAmbientUnderlay.yy",},"order":0,}, + {"id":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"order":0,}, + {"id":{"name":"oDynamicOccluder3","path":"objects/oDynamicOccluder3/oDynamicOccluder3.yy",},"order":0,}, + {"id":{"name":"oEmissive","path":"objects/oEmissive/oEmissive.yy",},"order":0,}, + {"id":{"name":"oInit","path":"objects/oInit/oInit.yy",},"order":0,}, + {"id":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"order":0,}, + {"id":{"name":"oLightDiscoooo3","path":"objects/oLightDiscoooo3/oLightDiscoooo3.yy",},"order":0,}, + {"id":{"name":"oLightPlasma","path":"objects/oLightPlasma/oLightPlasma.yy",},"order":0,}, + {"id":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"order":0,}, + {"id":{"name":"oPlayer3","path":"objects/oPlayer3/oPlayer3.yy",},"order":0,}, + {"id":{"name":"oPyramid","path":"objects/oPyramid/oPyramid.yy",},"order":0,}, + {"id":{"name":"oRenderer","path":"objects/oRenderer/oRenderer.yy",},"order":0,}, + {"id":{"name":"__shdBulbSpecular","path":"shaders/__shdBulbSpecular/__shdBulbSpecular.yy",},"order":6,}, {"id":{"name":"oRenderer3","path":"objects/oRenderer3/oRenderer3.yy",},"order":0,}, - {"id":{"name":"shdPremultiplyAlpha","path":"shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy",},"order":7,}, - {"id":{"name":"__shdBulbHardShadowsSunlight","path":"shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy",},"order":4,}, - {"id":{"name":"__shdBulbHardShadows","path":"shaders/__shdBulbHardShadows/__shdBulbHardShadows.yy",},"order":3,}, - {"id":{"name":"BulbRenderer","path":"scripts/BulbRenderer/BulbRenderer.yy",},"order":1,}, - {"id":{"name":"oDynamicOccluder3","path":"objects/oDynamicOccluder3/oDynamicOccluder3.yy",},"order":3,}, - {"id":{"name":"sLight1024","path":"sprites/sLight1024/sLight1024.yy",},"order":2,}, - {"id":{"name":"__shdBulbSoftShadows","path":"shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy",},"order":5,}, - {"id":{"name":"__shdBulbPremultiplyAlpha","path":"shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.yy",},"order":7,}, - {"id":{"name":"BulbShadowOverlay","path":"scripts/BulbShadowOverlay/BulbShadowOverlay.yy",},"order":8,}, - {"id":{"name":"oRenderer","path":"objects/oRenderer/oRenderer.yy",},"order":1,}, - {"id":{"name":"__BulbAddOcclusionSoft","path":"scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.yy",},"order":2,}, - {"id":{"name":"__shdBulbPassThrough","path":"shaders/__shdBulbPassThrough/__shdBulbPassThrough.yy",},"order":8,}, - {"id":{"name":"BulbSunlight","path":"scripts/BulbSunlight/BulbSunlight.yy",},"order":4,}, - {"id":{"name":"oInit","path":"objects/oInit/oInit.yy",},"order":1,}, - {"id":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"order":3,}, - {"id":{"name":"rmTestSoft","path":"rooms/rmTestSoft/rmTestSoft.yy",},"order":2,}, - {"id":{"name":"oShadowOverlay","path":"objects/oShadowOverlay/oShadowOverlay.yy",},"order":8,}, - {"id":{"name":"oAmbientUnderlay","path":"objects/oAmbientUnderlay/oAmbientUnderlay.yy",},"order":9,}, - {"id":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"order":4,}, - {"id":{"name":"__shdBulbHSVValueToAlpha","path":"shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.yy",},"order":10,}, - {"id":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"order":5,}, - {"id":{"name":"oStaticOccluder3","path":"objects/oStaticOccluder3/oStaticOccluder3.yy",},"order":2,}, - {"id":{"name":"BulbAmbienceSprite","path":"scripts/BulbAmbienceSprite/BulbAmbienceSprite.yy",},"order":7,}, - {"id":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"order":6,}, - {"id":{"name":"oLightPlasma","path":"objects/oLightPlasma/oLightPlasma.yy",},"order":7,}, - {"id":{"name":"BulbStaticOccluder","path":"scripts/BulbStaticOccluder/BulbStaticOccluder.yy",},"order":6,}, - {"id":{"name":"rmTestWithGroups","path":"rooms/rmTestWithGroups/rmTestWithGroups.yy",},"order":3,}, + {"id":{"name":"oRendererPar","path":"objects/oRendererPar/oRendererPar.yy",},"order":1,}, + {"id":{"name":"oShadowOverlay","path":"objects/oShadowOverlay/oShadowOverlay.yy",},"order":0,}, + {"id":{"name":"BulbSpecularMapDrawSpriteExt","path":"scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.yy",},"order":3,}, + {"id":{"name":"oPlayer2","path":"objects/oPlayer2/oPlayer2.yy",},"order":1,}, + {"id":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"order":0,}, + {"id":{"name":"oStaticOccluder3","path":"objects/oStaticOccluder3/oStaticOccluder3.yy",},"order":0,}, + {"id":{"name":"oSunlight","path":"objects/oSunlight/oSunlight.yy",},"order":0,}, {"id":{"name":"rmInit","path":"rooms/rmInit/rmInit.yy",},"order":0,}, + {"id":{"name":"rmTest","path":"rooms/rmTest/rmTest.yy",},"order":0,}, + {"id":{"name":"rmTestSoft","path":"rooms/rmTestSoft/rmTestSoft.yy",},"order":0,}, + {"id":{"name":"__shdBulbSpecularForce","path":"shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.yy",},"order":7,}, + {"id":{"name":"__BulbAddOcclusionHard","path":"scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.yy",},"order":0,}, + {"id":{"name":"__BulbAddOcclusionSoft","path":"scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.yy",},"order":1,}, + {"id":{"name":"__BulbConfig","path":"scripts/__BulbConfig/__BulbConfig.yy",},"order":0,}, + {"id":{"name":"__BulbConstants","path":"scripts/__BulbConstants/__BulbConstants.yy",},"order":1,}, + {"id":{"name":"__BulbError","path":"scripts/__BulbError/__BulbError.yy",},"order":2,}, + {"id":{"name":"__BulbRectInRect","path":"scripts/__BulbRectInRect/__BulbRectInRect.yy",},"order":3,}, + {"id":{"name":"__BulbRendererDefineAccumulateHard","path":"scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.yy",},"order":0,}, + {"id":{"name":"__BulbRendererDefineAccumulateSoft","path":"scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.yy",},"order":2,}, + {"id":{"name":"__BulbRendererDefineHDR","path":"scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.yy",},"order":3,}, + {"id":{"name":"__BulbRendererDefineLight","path":"scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.yy",},"order":4,}, + {"id":{"name":"__BulbRendererDefineNormal","path":"scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.yy",},"order":5,}, + {"id":{"name":"__BulbRendererDefineOverlayUnderlay","path":"scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.yy",},"order":6,}, + {"id":{"name":"__BulbRendererDefineVertexBuffers","path":"scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.yy",},"order":7,}, + {"id":{"name":"__BulbSystem","path":"scripts/__BulbSystem/__BulbSystem.yy",},"order":4,}, + {"id":{"name":"__BulbTrace","path":"scripts/__BulbTrace/__BulbTrace.yy",},"order":5,}, + {"id":{"name":"BulbAmbienceSprite","path":"scripts/BulbAmbienceSprite/BulbAmbienceSprite.yy",},"order":2,}, + {"id":{"name":"BulbDrawLitSurface","path":"scripts/BulbDrawLitSurface/BulbDrawLitSurface.yy",},"order":3,}, + {"id":{"name":"BulbDynamicOccluder","path":"scripts/BulbDynamicOccluder/BulbDynamicOccluder.yy",},"order":5,}, + {"id":{"name":"BulbLight","path":"scripts/BulbLight/BulbLight.yy",},"order":6,}, + {"id":{"name":"BulbLightOverlay","path":"scripts/BulbLightOverlay/BulbLightOverlay.yy",},"order":7,}, + {"id":{"name":"BulbNormalMapClear","path":"scripts/BulbNormalMapClear/BulbNormalMapClear.yy",},"order":0,}, + {"id":{"name":"BulbNormalMapDrawSelf","path":"scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.yy",},"order":1,}, + {"id":{"name":"BulbNormalMapDrawSprite","path":"scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.yy",},"order":2,}, + {"id":{"name":"oCircularOccluder","path":"objects/oCircularOccluder/oCircularOccluder.yy",},"order":1,}, + {"id":{"name":"BulbNormalMapDrawSpriteExt","path":"scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.yy",},"order":3,}, + {"id":{"name":"BulbNormalMapShaderReset","path":"scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.yy",},"order":5,}, + {"id":{"name":"BulbNormalMapShaderSet","path":"scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.yy",},"order":4,}, + {"id":{"name":"BulbRenderer","path":"scripts/BulbRenderer/BulbRenderer.yy",},"order":8,}, + {"id":{"name":"BulbShadowOverlay","path":"scripts/BulbShadowOverlay/BulbShadowOverlay.yy",},"order":9,}, + {"id":{"name":"BulbStaticOccluder","path":"scripts/BulbStaticOccluder/BulbStaticOccluder.yy",},"order":10,}, + {"id":{"name":"BulbSunlight","path":"scripts/BulbSunlight/BulbSunlight.yy",},"order":11,}, + {"id":{"name":"DebugOverlay","path":"scripts/DebugOverlay/DebugOverlay.yy",},"order":2,}, + {"id":{"name":"rmTestLightStrip","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",},"order":1,}, + {"id":{"name":"VertexCake","path":"scripts/VertexCake/VertexCake.yy",},"order":3,}, + {"id":{"name":"__shdBulbHardShadows","path":"shaders/__shdBulbHardShadows/__shdBulbHardShadows.yy",},"order":0,}, + {"id":{"name":"__shdBulbHardShadowsSunlight","path":"shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy",},"order":0,}, + {"id":{"name":"__shdBulbIntensity","path":"shaders/__shdBulbIntensity/__shdBulbIntensity.yy",},"order":1,}, + {"id":{"name":"__shdBulbKawaseDown","path":"shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.yy",},"order":0,}, + {"id":{"name":"__shdBulbKawaseDownWithThreshold","path":"shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.yy",},"order":0,}, + {"id":{"name":"__shdBulbKawaseUp","path":"shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.yy",},"order":0,}, + {"id":{"name":"__shdBulbLightWithNormalMap","path":"shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.yy",},"order":0,}, + {"id":{"name":"__shdBulbLightWithoutNormalMap","path":"shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.yy",},"order":0,}, + {"id":{"name":"__shdBulbLinearToGamma","path":"shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.yy",},"order":2,}, + {"id":{"name":"__shdBulbNormal","path":"shaders/__shdBulbNormal/__shdBulbNormal.yy",},"order":3,}, + {"id":{"name":"__shdBulbNormalUp","path":"shaders/__shdBulbNormalUp/__shdBulbNormalUp.yy",},"order":4,}, + {"id":{"name":"__shdBulbSoftShadows","path":"shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy",},"order":0,}, + {"id":{"name":"BulbSpecularMapShaderReset","path":"scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.yy",},"order":4,}, + {"id":{"name":"__shdBulbSoftShadowsSunlight","path":"shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy",},"order":0,}, + {"id":{"name":"sPyramidSpecular","path":"sprites/sPyramidSpecular/sPyramidSpecular.yy",},"order":13,}, + {"id":{"name":"__shdBulbSunlightWithNormalMap","path":"shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.yy",},"order":0,}, + {"id":{"name":"__shdBulbSunlightWithoutNormalMap","path":"shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.yy",},"order":0,}, + {"id":{"name":"__shdBulbThreshold","path":"shaders/__shdBulbThreshold/__shdBulbThreshold.yy",},"order":5,}, + {"id":{"name":"__shdBulbTonemapACES","path":"shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.yy",},"order":0,}, + {"id":{"name":"__shdBulbTonemapBadGamma","path":"shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.yy",},"order":1,}, + {"id":{"name":"__shdBulbTonemapClamp","path":"shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.yy",},"order":3,}, + {"id":{"name":"__shdBulbTonemapHBD","path":"shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.yy",},"order":4,}, + {"id":{"name":"__shdBulbTonemapReinhard","path":"shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.yy",},"order":5,}, + {"id":{"name":"__shdBulbTonemapReinhardExtended","path":"shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.yy",},"order":6,}, + {"id":{"name":"__shdBulbTonemapUncharted2","path":"shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.yy",},"order":7,}, + {"id":{"name":"__shdBulbTonemapUnreal3","path":"shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.yy",},"order":8,}, + {"id":{"name":"shdPremultiplyAlpha","path":"shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy",},"order":4,}, + {"id":{"name":"__sprBulbPixel","path":"sprites/__sprBulbPixel/__sprBulbPixel.yy",},"order":7,}, + {"id":{"name":"sDynamicBlock","path":"sprites/sDynamicBlock/sDynamicBlock.yy",},"order":0,}, + {"id":{"name":"oLightStrip","path":"objects/oLightStrip/oLightStrip.yy",},"order":3,}, + {"id":{"name":"sEmissive","path":"sprites/sEmissive/sEmissive.yy",},"order":1,}, + {"id":{"name":"sFloorNormal","path":"sprites/sFloorNormal/sFloorNormal.yy",},"order":2,}, + {"id":{"name":"sFloorTexture","path":"sprites/sFloorTexture/sFloorTexture.yy",},"order":3,}, + {"id":{"name":"sLight1024","path":"sprites/sLight1024/sLight1024.yy",},"order":4,}, + {"id":{"name":"sLight128","path":"sprites/sLight128/sLight128.yy",},"order":5,}, + {"id":{"name":"BulbSpecularMapDrawSprite","path":"scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.yy",},"order":2,}, + {"id":{"name":"__shdBulbTonemapNone","path":"shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.yy",},"order":2,}, + {"id":{"name":"sLight512","path":"sprites/sLight512/sLight512.yy",},"order":6,}, + {"id":{"name":"sLightDebug","path":"sprites/sLightDebug/sLightDebug.yy",},"order":7,}, + {"id":{"name":"sLightMask","path":"sprites/sLightMask/sLightMask.yy",},"order":8,}, + {"id":{"name":"sLightTorch","path":"sprites/sLightTorch/sLightTorch.yy",},"order":9,}, + {"id":{"name":"sPlayerMask","path":"sprites/sPlayerMask/sPlayerMask.yy",},"order":10,}, + {"id":{"name":"__BulbRendererDefineAccumulateHardNoStencil","path":"scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.yy",},"order":1,}, + {"id":{"name":"BulbApplyLightingToSurface","path":"scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.yy",},"order":4,}, + {"id":{"name":"oRenderer2","path":"objects/oRenderer2/oRenderer2.yy",},"order":2,}, + {"id":{"name":"BulbSpecularMapDrawSelf","path":"scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.yy",},"order":1,}, + {"id":{"name":"sPyramid","path":"sprites/sPyramid/sPyramid.yy",},"order":11,}, + {"id":{"name":"sPyramidNormal","path":"sprites/sPyramidNormal/sPyramidNormal.yy",},"order":12,}, + {"id":{"name":"BulbSpecularMapShaderSet","path":"scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.yy",},"order":0,}, + {"id":{"name":"sStaticBlock","path":"sprites/sStaticBlock/sStaticBlock.yy",},"order":14,}, ], "Options": [ - {"name":"iOS","path":"options/ios/options_ios.yy",}, - {"name":"Switch","path":"options/switch/options_switch.yy",}, + {"name":"Android","path":"options/android/options_android.yy",}, {"name":"HTML5","path":"options/html5/options_html5.yy",}, - {"name":"PlayStation 4","path":"options/ps4/options_ps4.yy",}, + {"name":"iOS","path":"options/ios/options_ios.yy",}, {"name":"Linux","path":"options/linux/options_linux.yy",}, {"name":"macOS","path":"options/mac/options_mac.yy",}, - {"name":"Android","path":"options/android/options_android.yy",}, - {"name":"Windows","path":"options/windows/options_windows.yy",}, {"name":"Main","path":"options/main/options_main.yy",}, {"name":"tvOS","path":"options/tvos/options_tvos.yy",}, - {"name":"Amazon Fire","path":"options/amazonfire/options_amazonfire.yy",}, + {"name":"Windows","path":"options/windows/options_windows.yy",}, {"name":"operagx","path":"options/operagx/options_operagx.yy",}, ], "defaultScriptType": 1, @@ -78,18 +133,27 @@ "RoomOrderNodes": [ {"roomId":{"name":"rmInit","path":"rooms/rmInit/rmInit.yy",},}, {"roomId":{"name":"rmTest","path":"rooms/rmTest/rmTest.yy",},}, + {"roomId":{"name":"rmTestLightStrip","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",},}, {"roomId":{"name":"rmTestSoft","path":"rooms/rmTestSoft/rmTestSoft.yy",},}, - {"roomId":{"name":"rmTestWithGroups","path":"rooms/rmTestWithGroups/rmTestWithGroups.yy",},}, ], "Folders": [ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Bulb","folderPath":"folders/Bulb.yy","order":0,}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"(System)","folderPath":"folders/Bulb/(System).yy","order":11,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"(System)","folderPath":"folders/Bulb/(System).yy","order":12,}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"(Pay no attention to that man behind the curtain)","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy","order":0,}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Example","folderPath":"folders/Example.yy","order":2,}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rmTest Objects","folderPath":"folders/Example/rmTest Objects.yy","order":2,}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rmTestSoft","folderPath":"folders/Example/rmTestSoft.yy","order":8,}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Sprites","folderPath":"folders/Example/Sprites.yy","order":0,}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Rooms","folderPath":"folders/Rooms.yy","order":3,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Renderer Definitions","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy","order":8,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Shaders","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy","order":9,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Kawase","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Kawase.yy","order":8,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Light","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Light.yy","order":9,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Shadow","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Shadow.yy","order":10,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Tonemapping","folderPath":"folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy","order":11,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Normal Map","folderPath":"folders/Bulb/Normal Map.yy","order":13,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Specular Map","folderPath":"folders/Bulb/Normal Map/Specular Map.yy","order":8,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Example","folderPath":"folders/Example.yy","order":0,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rmTest Objects","folderPath":"folders/Example/rmTest Objects.yy","order":5,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rmTestLightStrip","folderPath":"folders/Example/rmTestLightStrip.yy","order":7,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rmTestSoft","folderPath":"folders/Example/rmTestSoft.yy","order":6,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Sprites","folderPath":"folders/Example/Sprites.yy","order":8,}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Rooms","folderPath":"folders/Rooms.yy","order":0,}, ], "AudioGroups": [ {"resourceType":"GMAudioGroup","resourceVersion":"1.3","name":"audiogroup_default","targets":-1,}, @@ -97,7 +161,9 @@ "TextureGroups": [ {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","isScaled":true,"compressFormat":"bz2","loadType":"default","directory":"","autocrop":true,"border":2,"mipsToGenerate":0,"groupParent":null,"targets":-1,}, ], - "IncludedFiles": [], + "IncludedFiles": [ + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"bulb_license.txt","CopyToMask":-1,"filePath":"datafiles",}, + ], "MetaData": { "IDEVersion": "2022.0.2.51", }, diff --git a/README.md b/README.md index ccddecb..eb57271 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

-

Bulb 21.0.1

+

Bulb 22.0.7

-

2D lighting and shadows for GameMaker 2022 LTS

+

2D lighting and shadows for GameMaker 2024.8 (and 2022 LTS)

  diff --git a/datafiles/bulb_license.txt b/datafiles/bulb_license.txt new file mode 100644 index 0000000..da9072f --- /dev/null +++ b/datafiles/bulb_license.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Julian Adams + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/objects/oAmbientUnderlay/Create_0.gml b/objects/oAmbientUnderlay/Create_0.gml index 42619ab..e1f09da 100644 --- a/objects/oAmbientUnderlay/Create_0.gml +++ b/objects/oAmbientUnderlay/Create_0.gml @@ -1,4 +1,4 @@ -ambient = new BulbAmbienceSprite(oRenderer.lighting); +ambient = new BulbAmbienceSprite(oRendererPar.renderer); ambient.sprite = sprite_index; ambient.x = x; ambient.y = y; diff --git a/objects/oCircularOccluder/CleanUp_0.gml b/objects/oCircularOccluder/CleanUp_0.gml new file mode 100644 index 0000000..cd4895f --- /dev/null +++ b/objects/oCircularOccluder/CleanUp_0.gml @@ -0,0 +1 @@ +occluder.Destroy(); \ No newline at end of file diff --git a/objects/oCircularOccluder/Create_0.gml b/objects/oCircularOccluder/Create_0.gml new file mode 100644 index 0000000..a792759 --- /dev/null +++ b/objects/oCircularOccluder/Create_0.gml @@ -0,0 +1,5 @@ +occluder = new BulbDynamicOccluder(oRendererPar.renderer); +occluder.x = x; +occluder.y = y; + +occluder.AddCircle(32, 32, 0); \ No newline at end of file diff --git a/objects/oCircularOccluder/Step_0.gml b/objects/oCircularOccluder/Step_0.gml new file mode 100644 index 0000000..839085b --- /dev/null +++ b/objects/oCircularOccluder/Step_0.gml @@ -0,0 +1 @@ +occluder.angle += 1; \ No newline at end of file diff --git a/objects/oCircularOccluder/oCircularOccluder.yy b/objects/oCircularOccluder/oCircularOccluder.yy new file mode 100644 index 0000000..f39482d --- /dev/null +++ b/objects/oCircularOccluder/oCircularOccluder.yy @@ -0,0 +1,35 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oCircularOccluder", + "spriteId": null, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 0, + "physicsGroup": 0, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":12,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTest Objects", + "path": "folders/Example/rmTest Objects.yy", + }, +} \ No newline at end of file diff --git a/objects/oDynamicOccluder/Create_0.gml b/objects/oDynamicOccluder/Create_0.gml index 3312d7e..25f4a9c 100644 --- a/objects/oDynamicOccluder/Create_0.gml +++ b/objects/oDynamicOccluder/Create_0.gml @@ -1,10 +1,9 @@ image_angle = random(360); -occluder = new BulbDynamicOccluder(oRenderer.lighting); +occluder = new BulbDynamicOccluder(oRendererPar.renderer); occluder.x = x; occluder.y = y; occluder.angle = image_angle; -occluder.AddToRenderer(oRenderer.vision); var _l = -0.5*sprite_get_width(sprite_index); var _t = -0.5*sprite_get_height(sprite_index); diff --git a/objects/oDynamicOccluder3/Create_0.gml b/objects/oDynamicOccluder3/Create_0.gml index c58dd4e..876ea5c 100644 --- a/objects/oDynamicOccluder3/Create_0.gml +++ b/objects/oDynamicOccluder3/Create_0.gml @@ -1,6 +1,6 @@ image_angle = random(360); -occluder = new BulbDynamicOccluder(oRenderer3.lighting); +occluder = new BulbDynamicOccluder(oRenderer3.renderer); occluder.x = x; occluder.y = y; occluder.xscale = image_xscale; diff --git a/objects/oDynamicOccluder3/oDynamicOccluder3.yy b/objects/oDynamicOccluder3/oDynamicOccluder3.yy index a46f0be..e29cf83 100644 --- a/objects/oDynamicOccluder3/oDynamicOccluder3.yy +++ b/objects/oDynamicOccluder3/oDynamicOccluder3.yy @@ -1,10 +1,14 @@ { + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oDynamicOccluder3", "spriteId": { "name": "sDynamicBlock", "path": "sprites/sDynamicBlock/sDynamicBlock.yy", }, "solid": false, "visible": true, + "managed": true, "spriteMaskId": null, "persistent": false, "parentObjectId": null, @@ -21,8 +25,8 @@ "physicsKinematic": false, "physicsShapePoints": [], "eventList": [ - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, ], "properties": [], "overriddenProperties": [], @@ -30,8 +34,4 @@ "name": "rmTestSoft", "path": "folders/Example/rmTestSoft.yy", }, - "resourceVersion": "1.0", - "name": "oDynamicOccluder3", - "tags": [], - "resourceType": "GMObject", } \ No newline at end of file diff --git a/objects/oEmissive/CleanUp_0.gml b/objects/oEmissive/CleanUp_0.gml new file mode 100644 index 0000000..3411370 --- /dev/null +++ b/objects/oEmissive/CleanUp_0.gml @@ -0,0 +1 @@ +light.Destroy(); \ No newline at end of file diff --git a/objects/oEmissive/Create_0.gml b/objects/oEmissive/Create_0.gml new file mode 100644 index 0000000..fb0a7c3 --- /dev/null +++ b/objects/oEmissive/Create_0.gml @@ -0,0 +1,5 @@ +light = new BulbLight(oRendererPar.renderer, sprite_index, image_index, x, y); +light.castShadows = false; +light.intensity = 5; +light.blend = #C04010; +light.normalMap = false; \ No newline at end of file diff --git a/objects/oEmissive/Step_0.gml b/objects/oEmissive/Step_0.gml new file mode 100644 index 0000000..06a3b02 --- /dev/null +++ b/objects/oEmissive/Step_0.gml @@ -0,0 +1 @@ +light.intensity = lerp(1, 5, 0.5 + 0.5*dsin(current_time/20)); \ No newline at end of file diff --git a/objects/oEmissive/oEmissive.yy b/objects/oEmissive/oEmissive.yy new file mode 100644 index 0000000..12387c8 --- /dev/null +++ b/objects/oEmissive/oEmissive.yy @@ -0,0 +1,38 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oEmissive", + "spriteId": { + "name": "sEmissive", + "path": "sprites/sEmissive/sEmissive.yy", + }, + "solid": false, + "visible": false, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":12,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTest Objects", + "path": "folders/Example/rmTest Objects.yy", + }, +} \ No newline at end of file diff --git a/objects/oInit/oInit.yy b/objects/oInit/oInit.yy index 649b5ef..aa38167 100644 --- a/objects/oInit/oInit.yy +++ b/objects/oInit/oInit.yy @@ -1,7 +1,11 @@ { + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oInit", "spriteId": null, "solid": false, "visible": true, + "managed": true, "spriteMaskId": null, "persistent": false, "parentObjectId": null, @@ -18,7 +22,7 @@ "physicsKinematic": false, "physicsShapePoints": [], "eventList": [ - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, ], "properties": [], "overriddenProperties": [], @@ -26,8 +30,4 @@ "name": "Example", "path": "folders/Example.yy", }, - "resourceVersion": "1.0", - "name": "oInit", - "tags": [], - "resourceType": "GMObject", } \ No newline at end of file diff --git a/objects/oLightDiscoooo/Create_0.gml b/objects/oLightDiscoooo/Create_0.gml index 811d605..f38f695 100644 --- a/objects/oLightDiscoooo/Create_0.gml +++ b/objects/oLightDiscoooo/Create_0.gml @@ -4,6 +4,10 @@ blendCycle = random(255); speed = random_range(0.8, 0.9); direction = random(360); -light = new BulbLight(oRenderer.lighting, sLight512, 0, x, y); +light = new BulbLight(oRendererPar.renderer, sLight512, 0, x, y); light.penumbraSize = 30; -light.blend = make_colour_hsv(blendCycle, 230, 230); \ No newline at end of file +light.blend = make_colour_hsv(blendCycle, 230, 230); + +//Turn on normal maps for this light +//This would typically be done using the `BULB_DEFAULT_USE_NORMAL_MAP` +light.normalMap = true; \ No newline at end of file diff --git a/objects/oLightDiscoooo/Draw_0.gml b/objects/oLightDiscoooo/Draw_0.gml index e0094ba..2c5dfb7 100644 --- a/objects/oLightDiscoooo/Draw_0.gml +++ b/objects/oLightDiscoooo/Draw_0.gml @@ -1,2 +1,2 @@ //Usually you'd want to draw nothing... -if (oRenderer.showDebug) draw_sprite_ext(sLightDebug, 0, x, y, 1, 1, 0, image_blend, 1); \ No newline at end of file +if (oRendererPar.showDebug) draw_sprite_ext(sLightDebug, 0, x, y, 1, 1, 0, image_blend, 1); \ No newline at end of file diff --git a/objects/oLightDiscoooo3/Create_0.gml b/objects/oLightDiscoooo3/Create_0.gml index 3f67b99..79cf848 100644 --- a/objects/oLightDiscoooo3/Create_0.gml +++ b/objects/oLightDiscoooo3/Create_0.gml @@ -1,6 +1,6 @@ blendCycleSpeed = random_range(0.1, 1); blendCycle = random(255); -light = new BulbLight(oRenderer3.lighting, sLight512, 0, x, y); +light = new BulbLight(oRenderer3.renderer, sLight512, 0, x, y); light.penumbraSize = 30; light.blend = make_colour_hsv(blendCycle, 230, 230); \ No newline at end of file diff --git a/objects/oLightPlasma/Create_0.gml b/objects/oLightPlasma/Create_0.gml index a75ab25..987073c 100644 --- a/objects/oLightPlasma/Create_0.gml +++ b/objects/oLightPlasma/Create_0.gml @@ -1,5 +1,12 @@ destroying = false; -light = new BulbLight(oRenderer.lighting, sLight128, 0, x, y); +light = new BulbLight(oRendererPar.renderer, sLight128, 0, x, y); light.blend = make_colour_hsv(random_range(70, 90), 230, 230); -light.penumbraSize = 30; \ No newline at end of file +light.castShadows = true; +light.xscale = 0.3; +light.yscale = 0.3; +light.intensity = 15; + +//Turn on normal maps for this light +//This would typically be done using the `BULB_DEFAULT_USE_NORMAL_MAP` +light.normalMap = true; \ No newline at end of file diff --git a/objects/oLightPlasma/Draw_0.gml b/objects/oLightPlasma/Draw_0.gml index e0094ba..2c5dfb7 100644 --- a/objects/oLightPlasma/Draw_0.gml +++ b/objects/oLightPlasma/Draw_0.gml @@ -1,2 +1,2 @@ //Usually you'd want to draw nothing... -if (oRenderer.showDebug) draw_sprite_ext(sLightDebug, 0, x, y, 1, 1, 0, image_blend, 1); \ No newline at end of file +if (oRendererPar.showDebug) draw_sprite_ext(sLightDebug, 0, x, y, 1, 1, 0, image_blend, 1); \ No newline at end of file diff --git a/objects/oLightPlasma/Step_0.gml b/objects/oLightPlasma/Step_0.gml index 8b77e75..9e95501 100644 --- a/objects/oLightPlasma/Step_0.gml +++ b/objects/oLightPlasma/Step_0.gml @@ -1,10 +1,10 @@ if (destroying) { - light.alpha -= 0.05; + light.intensity -= 0.2; - if (light.alpha <= 0) + if (light.intensity <= 0) { - light.alpha = 0; + light.intensity = 0; light.Destroy(); instance_destroy(); } diff --git a/objects/oLightStrip/Create_0.gml b/objects/oLightStrip/Create_0.gml new file mode 100644 index 0000000..0b623df --- /dev/null +++ b/objects/oLightStrip/Create_0.gml @@ -0,0 +1,17 @@ +var _count = 50; + +lightArray = []; + +var _i = 0; +var _y = 0; +repeat(_count) +{ + var _light = new BulbLight(oRendererPar.renderer, sLight1024, 0, x, y + _y); + _light.blend = make_colour_hsv(lerp(0, 150, _i), 230, 230); + _light.intensity = 0.02; + + lightArray[_y] = _light; + + _i += 1 / (_count-1); + _y += 10; +} \ No newline at end of file diff --git a/objects/oLightStrip/oLightStrip.yy b/objects/oLightStrip/oLightStrip.yy new file mode 100644 index 0000000..1d4357e --- /dev/null +++ b/objects/oLightStrip/oLightStrip.yy @@ -0,0 +1,33 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oLightStrip", + "spriteId": null, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTestLightStrip", + "path": "folders/Example/rmTestLightStrip.yy", + }, +} \ No newline at end of file diff --git a/objects/oPlayer/Create_0.gml b/objects/oPlayer/Create_0.gml index 8a8fbcf..0e40a09 100644 --- a/objects/oPlayer/Create_0.gml +++ b/objects/oPlayer/Create_0.gml @@ -1,10 +1,10 @@ -light = new BulbLight(oRenderer.lighting, sLightTorch, 0, x, y); +light = new BulbLight(oRendererPar.renderer, sLightTorch, 0, x, y); +light.z = 100; light.penumbraSize = 30; light.yscale = 0.5; light.blend = make_colour_rgb(255, 255, 100); +light.intensity = 1.5; -visionCone = new BulbLight(oRenderer.vision, sLightTorch, 0, x, y); -visionCone.penumbraSize = 30; -visionCone.xscale = 2; -visionCone.yscale = 2; -visionCone.blend = c_white; \ No newline at end of file +//Turn on normal maps for this light +//This would typically be done using the `BULB_DEFAULT_USE_NORMAL_MAP` +light.normalMap = true; \ No newline at end of file diff --git a/objects/oPlayer/Step_0.gml b/objects/oPlayer/Step_0.gml index 1b65e4e..ac70103 100644 --- a/objects/oPlayer/Step_0.gml +++ b/objects/oPlayer/Step_0.gml @@ -19,9 +19,12 @@ if (mouse_check_button(mb_left) and (alarm_get(0) <= 0)) } //Update camera position -camera_set_view_pos(oRenderer.camera, - round(x - 0.5*camera_get_view_width( oRenderer.camera)), - round(y - 0.5*camera_get_view_height(oRenderer.camera))); +camera_set_view_pos(oRendererPar.camera, + x - 0.5*camera_get_view_width( oRendererPar.camera), + y - 0.5*camera_get_view_height(oRendererPar.camera)); + +if (keyboard_check(ord("Q"))) camera_set_view_angle(oRendererPar.camera, camera_get_view_angle(oRendererPar.camera) + 0.5); +if (keyboard_check(ord("E"))) camera_set_view_angle(oRendererPar.camera, camera_get_view_angle(oRendererPar.camera) - 0.5); //Make sure the light tracks the player light.x = x; @@ -29,8 +32,4 @@ light.y = y; light.angle = point_direction(x, y, mouse_x, mouse_y); //Allow the right mouse button to toggle the light -if (mouse_check_button_pressed(mb_right)) light.visible = !light.visible; - -visionCone.x = x; -visionCone.y = y; -visionCone.angle = point_direction(x, y, mouse_x, mouse_y); \ No newline at end of file +if (mouse_check_button_pressed(mb_right)) light.visible = !light.visible; \ No newline at end of file diff --git a/objects/oPlayer2/Step_0.gml b/objects/oPlayer2/Step_0.gml new file mode 100644 index 0000000..b3e4770 --- /dev/null +++ b/objects/oPlayer2/Step_0.gml @@ -0,0 +1,10 @@ +//Player input +if (keyboard_check(vk_up )) || (keyboard_check(ord("W"))) y -= 5; +if (keyboard_check(vk_down )) || (keyboard_check(ord("S"))) y += 5; +if (keyboard_check(vk_left )) || (keyboard_check(ord("A"))) x -= 5; +if (keyboard_check(vk_right)) || (keyboard_check(ord("D"))) x += 5; + +//Update camera position +camera_set_view_pos(oRendererPar.camera, + round(x - 0.5*camera_get_view_width( oRendererPar.camera)), + round(y - 0.5*camera_get_view_height(oRendererPar.camera))); \ No newline at end of file diff --git a/objects/oPlayer2/oPlayer.yy b/objects/oPlayer2/oPlayer.yy new file mode 100644 index 0000000..dfdcb96 --- /dev/null +++ b/objects/oPlayer2/oPlayer.yy @@ -0,0 +1,38 @@ +{ + "spriteId": { + "name": "sPlayerMask", + "path": "sprites/sPlayerMask/sPlayerMask.yy", + }, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 0, + "physicsGroup": 0, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":2,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTest Objects", + "path": "folders/Example/rmTest Objects.yy", + }, + "resourceVersion": "1.0", + "name": "oPlayer", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/oPlayer2/oPlayer2.yy b/objects/oPlayer2/oPlayer2.yy new file mode 100644 index 0000000..d670ce9 --- /dev/null +++ b/objects/oPlayer2/oPlayer2.yy @@ -0,0 +1,36 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oPlayer2", + "spriteId": { + "name": "sPlayerMask", + "path": "sprites/sPlayerMask/sPlayerMask.yy", + }, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 0, + "physicsGroup": 0, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTestLightStrip", + "path": "folders/Example/rmTestLightStrip.yy", + }, +} \ No newline at end of file diff --git a/objects/oPlayer3/Create_0.gml b/objects/oPlayer3/Create_0.gml index db2d0b1..f83e0a7 100644 --- a/objects/oPlayer3/Create_0.gml +++ b/objects/oPlayer3/Create_0.gml @@ -1,4 +1,5 @@ -light = new BulbLight(oRenderer3.lighting, sLightTorch, 0, x, y); +light = new BulbLight(oRenderer3.renderer, sLightTorch, 0, x, y); +light.z = 100; light.penumbraSize = 30; light.xscale = 2.0; light.blend = make_colour_rgb(255, 255, 100); \ No newline at end of file diff --git a/objects/oPlayer3/oPlayer3.yy b/objects/oPlayer3/oPlayer3.yy index 4cefad8..3d58cd8 100644 --- a/objects/oPlayer3/oPlayer3.yy +++ b/objects/oPlayer3/oPlayer3.yy @@ -1,10 +1,14 @@ { + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oPlayer3", "spriteId": { "name": "sPlayerMask", "path": "sprites/sPlayerMask/sPlayerMask.yy", }, "solid": false, "visible": true, + "managed": true, "spriteMaskId": null, "persistent": false, "parentObjectId": null, @@ -21,8 +25,8 @@ "physicsKinematic": false, "physicsShapePoints": [], "eventList": [ - {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, ], "properties": [], "overriddenProperties": [], @@ -30,8 +34,4 @@ "name": "rmTestSoft", "path": "folders/Example/rmTestSoft.yy", }, - "resourceVersion": "1.0", - "name": "oPlayer3", - "tags": [], - "resourceType": "GMObject", } \ No newline at end of file diff --git a/objects/oPyramid/Step_0.gml b/objects/oPyramid/Step_0.gml new file mode 100644 index 0000000..38a6588 --- /dev/null +++ b/objects/oPyramid/Step_0.gml @@ -0,0 +1 @@ +image_angle = current_time/25; \ No newline at end of file diff --git a/objects/oPyramid/oPyramid.yy b/objects/oPyramid/oPyramid.yy new file mode 100644 index 0000000..e0fb84a --- /dev/null +++ b/objects/oPyramid/oPyramid.yy @@ -0,0 +1,36 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oPyramid", + "spriteId": { + "name": "sPyramid", + "path": "sprites/sPyramid/sPyramid.yy", + }, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTest Objects", + "path": "folders/Example/rmTest Objects.yy", + }, +} \ No newline at end of file diff --git a/objects/oRenderer/Create_0.gml b/objects/oRenderer/Create_0.gml index 2aaf26c..39f0ace 100644 --- a/objects/oRenderer/Create_0.gml +++ b/objects/oRenderer/Create_0.gml @@ -1,30 +1,56 @@ -//Create a camera +//Create a camera manually so we don't have to torture ourselves with the room editor view_enabled = true; view_set_visible(0, true); camera = camera_create_view(x - 640, y - 360, 1280, 720, 0, noone, 0, 0, 0, 0); view_set_camera(0, camera); -//Start the lighting system -lighting = new BulbRenderer(make_colour_rgb(50, 50, 80), BULB_MODE.SOFT_BM_ADD, true); -lighting.SetSurfaceDimensionsFromCamera(camera); -lighting.SetClippingSurface(true, 1.0, false, true); +////////////////////// +// // +// Renderer Setup // +// // +////////////////////// -vision = new BulbRenderer(c_black, BULB_MODE.SOFT_BM_ADD, true); +//We'll be drawing the application surface ourselves (see Post-Draw event) +application_surface_draw_enable(false); + +//Start the renderer system +renderer = new BulbRenderer(camera); + +//Set up ambient light. As this is a lighting value, the ambient color is defined in linear color +//space. +renderer.ambientColor = make_colour_rgb(10, 10, 20); + +//Use soft shadows +renderer.soft = true; + +//Use texture filtering (bilinear interpolation) wherever possible +renderer.smooth = true; + +//Turn on normal maps +//This would typically be done using the `BULB_DEFAULT_USE_NORMAL_MAP` +renderer.normalMap = true; + +//Set up HDR +renderer.hdr = true; +renderer.hdrBloomIntensity = 0.5; +renderer.hdrBloomIterations = 4; + +//Copy the HDR tonemap across to LDR. You normally want to stick to `BULB_TONEMAP_NONE` when nont +//in HDR mode. For the sake of example, however, we want the two tonemaps to match. +renderer.ldrTonemap = renderer.hdrTonemap; + +//////////////////////////// +// // +// Example-related code // +// // +//////////////////////////// //Set up a vertex buffer for drawing the diffuse base texture for the walls -//This isn't strictly part of the lighting example +//We populate this in the Room Start event staticBlocks = new VertexCake(); -staticBlocks.Bake(oStaticOccluder, sStaticBlock, 0, true); //Some debug values showDebug = false; -drawEndTime = 300; -smoothedDrawEndTime = 300; smoothedFrameTime = 1; smoothedFPS = 1000; -alarm_set(0, 30); - -sunlight = new BulbSunlight(lighting, 45); -sunlight.blend = c_red; -sunlight.alpha = 0.4; -sunlight.penumbraSize = 5; \ No newline at end of file +alarm_set(0, 30); \ No newline at end of file diff --git a/objects/oRenderer/Draw_64.gml b/objects/oRenderer/Draw_64.gml index ceaa553..b462f7a 100644 --- a/objects/oRenderer/Draw_64.gml +++ b/objects/oRenderer/Draw_64.gml @@ -1,7 +1,7 @@ //Draw the debug overlay DebugOverlay(); -var _colour = lighting.GetSurfacePixelFromCamera(mouse_x, mouse_y, camera); +var _colour = renderer.GetLightValue(mouse_x, mouse_y); draw_set_colour(_colour); -draw_rectangle(display_get_gui_width() - 110, 10, display_get_gui_width() - 10, 110, false); +draw_rectangle(display_get_gui_width() - 60, 10, display_get_gui_width() - 10, 60, false); draw_set_colour(c_white); \ No newline at end of file diff --git a/objects/oRenderer/Draw_73.gml b/objects/oRenderer/Draw_73.gml index f3feafd..371c700 100644 --- a/objects/oRenderer/Draw_73.gml +++ b/objects/oRenderer/Draw_73.gml @@ -1,15 +1,42 @@ -var _t = get_timer(); +//Update the renderer's normal map +if (renderer.normalMap) +{ + //First we target the normal map surface + surface_set_target(renderer.GetNormalMapSurface()); + + //Then we apply the camera. This ensure we're drawing from the same "point of view" as the + //rest of the renderer + camera_apply(view_get_camera(0)); + + //Clear off any normal map information from the previous frame + BulbNormalMapClear(); + + //Set the normal mapping shader. This is required if you want to use the `BulbNormalMapDraw*()` + //functions (which is recommended). + BulbNormalMapShaderSet(); + + draw_sprite_tiled(sFloorNormal, 0, 0, 0); + + with(oPyramid) + { + BulbNormalMapDrawSelf(sPyramidNormal); + } + + //Now we set the normal map shader but this time with `forceUpNormal` set to `true`. This means + //that anything we draw afterwards will be drawn completely flat. + BulbNormalMapShaderSet(true); + + staticBlocks.Draw(); + + with(oDynamicOccluder) + { + BulbNormalMapDrawSelf(); + } + + //Reset the surface target and the shader, and we're done + surface_reset_target() + BulbNormalMapShaderReset(); +} -////Update the vision cone -//vision.UpdateFromCamera(camera); -// -////Copy the vision cone to the lighting clipping surface -//lighting.CopyClippingSurface(vision.GetSurface()); - -//Update the lighting -lighting.UpdateFromCamera(camera); - -//Draw onto the application surface via the camera -lighting.DrawOnCamera(camera); - -drawEndTime = get_timer() - _t; \ No newline at end of file +//Update the renderer. You should do this after updating the normal map! +renderer.Update(); \ No newline at end of file diff --git a/objects/oRenderer/Draw_77.gml b/objects/oRenderer/Draw_77.gml new file mode 100644 index 0000000..f354e0f --- /dev/null +++ b/objects/oRenderer/Draw_77.gml @@ -0,0 +1,7 @@ +//Draw the application surface to the screen +BulbDrawLitSurface(renderer, application_surface); + +if (keyboard_check(ord("N"))) +{ + renderer.DrawNormalMapDebug(0, 0, 1280, 720); +} \ No newline at end of file diff --git a/objects/oRenderer/Other_4.gml b/objects/oRenderer/Other_4.gml new file mode 100644 index 0000000..eb2e72a --- /dev/null +++ b/objects/oRenderer/Other_4.gml @@ -0,0 +1,2 @@ +//Populate the vertex cake and bake it +staticBlocks.Bake(oStaticOccluder, sStaticBlock, 0, true); \ No newline at end of file diff --git a/objects/oRenderer/Other_5.gml b/objects/oRenderer/Other_5.gml index 854aa79..546e0c0 100644 --- a/objects/oRenderer/Other_5.gml +++ b/objects/oRenderer/Other_5.gml @@ -5,5 +5,5 @@ camera_destroy(camera); //Destroy the walls vertex buffer staticBlocks.Free(); -//Destroy the lighting system (you still need to destroy each light instance!) -lighting.Free(); \ No newline at end of file +//Destroy the renderer system (you still need to destroy each light instance!) +renderer.Free(); \ No newline at end of file diff --git a/objects/oRenderer/Step_0.gml b/objects/oRenderer/Step_0.gml index 46bc5e4..796598b 100644 --- a/objects/oRenderer/Step_0.gml +++ b/objects/oRenderer/Step_0.gml @@ -4,7 +4,6 @@ if (keyboard_check_pressed(vk_escape)) game_end(); if (keyboard_check_pressed(vk_f1)) { showDebug = !showDebug; - show_debug_overlay(showDebug); } if (keyboard_check_pressed(ord("L"))) instance_create_depth(oPlayer.x, oPlayer.y, 0, oLightDiscoooo); @@ -14,8 +13,16 @@ if (keyboard_check_pressed(ord("O"))) instance_create_depth(oPlayer.x, oPlayer.y if ((keyboard_check(ord("T"))) && (fps_real > 61) && (fps > 55)) instance_create_depth(oPlayer.x, oPlayer.y, 0, oLightDiscoooo); if (keyboard_check_pressed(ord("1"))) with(oLightDiscoooo) light.visible = !light.visible; +if (keyboard_check_pressed(ord("2"))) renderer.soft = !renderer.soft; +if (keyboard_check_pressed(ord("3"))) renderer.selfLighting = !renderer.selfLighting; +if (keyboard_check_pressed(ord("4"))) renderer.hdr = !renderer.hdr; +if (keyboard_check_pressed(ord("5"))) +{ + renderer.hdrTonemap = (renderer.hdrTonemap + 1) mod 9; + renderer.ldrTonemap = renderer.hdrTonemap; +} -if (keyboard_check_pressed(ord("2"))) lighting.mode = (lighting.mode + 1) mod BULB_MODE.__SIZE; +if (keyboard_check_pressed(ord("6"))) renderer.normalMap = !renderer.normalMap; //Update debug timers if (alarm_get(1) < 0) @@ -25,8 +32,4 @@ if (alarm_get(1) < 0) smoothedFrameTime = lerp(smoothedFrameTime, 1000/fps_real, 0.005); smoothedFPS = lerp(smoothedFPS, fps_real, 0.005); } - - smoothedDrawEndTime = lerp(smoothedDrawEndTime, drawEndTime, 0.005); -} - -sunlight.angle += 0.1; \ No newline at end of file +} \ No newline at end of file diff --git a/objects/oRenderer/oRenderer.yy b/objects/oRenderer/oRenderer.yy index 06f3e2f..7e895ea 100644 --- a/objects/oRenderer/oRenderer.yy +++ b/objects/oRenderer/oRenderer.yy @@ -8,7 +8,10 @@ "managed": true, "spriteMaskId": null, "persistent": false, - "parentObjectId": null, + "parentObjectId": { + "name": "oRendererPar", + "path": "objects/oRendererPar/oRendererPar.yy", + }, "physicsObject": false, "physicsSensor": false, "physicsShape": 1, @@ -29,6 +32,8 @@ {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":73,"eventType":8,"collisionObjectId":null,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":5,"eventType":7,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":77,"eventType":8,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":4,"eventType":7,"collisionObjectId":null,}, ], "properties": [], "overriddenProperties": [], diff --git a/objects/oRenderer2/Create_0.gml b/objects/oRenderer2/Create_0.gml new file mode 100644 index 0000000..264c9b1 --- /dev/null +++ b/objects/oRenderer2/Create_0.gml @@ -0,0 +1,12 @@ +application_surface_draw_enable(false); + +view_enabled = true; +view_set_visible(0, true); +camera = camera_create_view(x - 640, y - 360, 1280, 720, 0, noone, 0, 0, 0, 0); +view_set_camera(0, camera); + +renderer = new BulbRenderer(camera); +renderer.soft = false; +renderer.ldrTonemap = BULB_TONEMAP_ACES; + +staticBlocks = new VertexCake(); \ No newline at end of file diff --git a/objects/oRenderer2/Draw_0.gml b/objects/oRenderer2/Draw_0.gml new file mode 100644 index 0000000..ed8acf6 --- /dev/null +++ b/objects/oRenderer2/Draw_0.gml @@ -0,0 +1 @@ +staticBlocks.Draw(); \ No newline at end of file diff --git a/objects/oRenderer2/Draw_73.gml b/objects/oRenderer2/Draw_73.gml new file mode 100644 index 0000000..ad65246 --- /dev/null +++ b/objects/oRenderer2/Draw_73.gml @@ -0,0 +1 @@ +renderer.Update(); \ No newline at end of file diff --git a/objects/oRenderer2/Draw_77.gml b/objects/oRenderer2/Draw_77.gml new file mode 100644 index 0000000..4907a02 --- /dev/null +++ b/objects/oRenderer2/Draw_77.gml @@ -0,0 +1 @@ +BulbDrawLitSurface(renderer, application_surface); \ No newline at end of file diff --git a/objects/oRenderer2/Other_4.gml b/objects/oRenderer2/Other_4.gml new file mode 100644 index 0000000..34bc374 --- /dev/null +++ b/objects/oRenderer2/Other_4.gml @@ -0,0 +1 @@ +staticBlocks.Bake(oStaticOccluder, sStaticBlock, 0, true); \ No newline at end of file diff --git a/objects/oRenderer2/Other_5.gml b/objects/oRenderer2/Other_5.gml new file mode 100644 index 0000000..c871ccb --- /dev/null +++ b/objects/oRenderer2/Other_5.gml @@ -0,0 +1,6 @@ +view_set_camera(0, noone); +camera_destroy(camera); + +staticBlocks.Free(); + +renderer.Free(); \ No newline at end of file diff --git a/objects/oRenderer2/Step_0.gml b/objects/oRenderer2/Step_0.gml new file mode 100644 index 0000000..c53a90d --- /dev/null +++ b/objects/oRenderer2/Step_0.gml @@ -0,0 +1 @@ +if (keyboard_check_pressed(vk_escape)) game_end(); \ No newline at end of file diff --git a/objects/oRenderer2/oRenderer.yy b/objects/oRenderer2/oRenderer.yy new file mode 100644 index 0000000..5a3b566 --- /dev/null +++ b/objects/oRenderer2/oRenderer.yy @@ -0,0 +1,39 @@ +{ + "spriteId": null, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":2,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":73,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":5,"eventType":7,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTest Objects", + "path": "folders/Example/rmTest Objects.yy", + }, + "resourceVersion": "1.0", + "name": "oRenderer", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/objects/oRenderer2/oRenderer2.yy b/objects/oRenderer2/oRenderer2.yy new file mode 100644 index 0000000..6f9d24c --- /dev/null +++ b/objects/oRenderer2/oRenderer2.yy @@ -0,0 +1,42 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oRenderer2", + "spriteId": null, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": { + "name": "oRendererPar", + "path": "objects/oRendererPar/oRendererPar.yy", + }, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":73,"eventType":8,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":5,"eventType":7,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":77,"eventType":8,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":4,"eventType":7,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTestLightStrip", + "path": "folders/Example/rmTestLightStrip.yy", + }, +} \ No newline at end of file diff --git a/objects/oRenderer3/Create_0.gml b/objects/oRenderer3/Create_0.gml index 12548b4..9a6c8bf 100644 --- a/objects/oRenderer3/Create_0.gml +++ b/objects/oRenderer3/Create_0.gml @@ -1,13 +1,20 @@ -//Create a camera +application_surface_draw_enable(false); + view_enabled = true; view_set_visible(0, true); camera = camera_create_view(x - 640, y - 360, 1280, 720, 0, noone, 0, 0, 0, 0); view_set_camera(0, camera); -//Start the lighting system -lighting = new BulbRenderer(make_colour_rgb(50, 50, 80), BULB_MODE.SOFT_BM_ADD, true); +renderer = new BulbRenderer(camera); +renderer.ambientColor = make_colour_rgb(50, 50, 80); +renderer.selfLighting = true; +renderer.soft = true; +renderer.smooth = true; -//Set up a vertex buffer for drawing the diffuse base texture for the walls -//This isn't strictly part of the lighting example staticBlocks = new VertexCake(); -staticBlocks.Bake(oStaticOccluder3, sStaticBlock, 0, true); \ No newline at end of file +staticBlocks.Bake(oStaticOccluder, sStaticBlock, 0, true); + +sunlight = new BulbSunlight(renderer, 45); +sunlight.blend = c_red; +sunlight.intensity = 1; +sunlight.penumbraSize = 5; \ No newline at end of file diff --git a/objects/oRenderer3/Draw_0.gml b/objects/oRenderer3/Draw_0.gml index 515df9f..ed8acf6 100644 --- a/objects/oRenderer3/Draw_0.gml +++ b/objects/oRenderer3/Draw_0.gml @@ -1,2 +1 @@ -//Draw the walls as one big batch staticBlocks.Draw(); \ No newline at end of file diff --git a/objects/oRenderer3/Draw_73.gml b/objects/oRenderer3/Draw_73.gml index 8e2aacb..ad65246 100644 --- a/objects/oRenderer3/Draw_73.gml +++ b/objects/oRenderer3/Draw_73.gml @@ -1,2 +1 @@ -lighting.UpdateFromCamera(camera); -lighting.DrawOnCamera(camera); \ No newline at end of file +renderer.Update(); \ No newline at end of file diff --git a/objects/oRenderer3/Draw_77.gml b/objects/oRenderer3/Draw_77.gml new file mode 100644 index 0000000..4907a02 --- /dev/null +++ b/objects/oRenderer3/Draw_77.gml @@ -0,0 +1 @@ +BulbDrawLitSurface(renderer, application_surface); \ No newline at end of file diff --git a/objects/oRenderer3/Other_5.gml b/objects/oRenderer3/Other_5.gml index 854aa79..c871ccb 100644 --- a/objects/oRenderer3/Other_5.gml +++ b/objects/oRenderer3/Other_5.gml @@ -1,9 +1,6 @@ -//Destroy the camera we set up view_set_camera(0, noone); camera_destroy(camera); -//Destroy the walls vertex buffer staticBlocks.Free(); -//Destroy the lighting system (you still need to destroy each light instance!) -lighting.Free(); \ No newline at end of file +renderer.Free(); \ No newline at end of file diff --git a/objects/oRenderer3/oRenderer3.yy b/objects/oRenderer3/oRenderer3.yy index bde9752..c4b88d7 100644 --- a/objects/oRenderer3/oRenderer3.yy +++ b/objects/oRenderer3/oRenderer3.yy @@ -1,10 +1,17 @@ { + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oRenderer3", "spriteId": null, "solid": false, "visible": true, + "managed": true, "spriteMaskId": null, "persistent": false, - "parentObjectId": null, + "parentObjectId": { + "name": "oRendererPar", + "path": "objects/oRendererPar/oRendererPar.yy", + }, "physicsObject": false, "physicsSensor": false, "physicsShape": 1, @@ -18,11 +25,12 @@ "physicsKinematic": false, "physicsShapePoints": [], "eventList": [ - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":73,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, - {"isDnD":false,"eventNum":5,"eventType":7,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":73,"eventType":8,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":5,"eventType":7,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":77,"eventType":8,"collisionObjectId":null,}, ], "properties": [], "overriddenProperties": [], @@ -30,8 +38,4 @@ "name": "rmTestSoft", "path": "folders/Example/rmTestSoft.yy", }, - "resourceVersion": "1.0", - "name": "oRenderer3", - "tags": [], - "resourceType": "GMObject", } \ No newline at end of file diff --git a/objects/oRendererPar/oRendererPar.yy b/objects/oRendererPar/oRendererPar.yy new file mode 100644 index 0000000..63a3cf2 --- /dev/null +++ b/objects/oRendererPar/oRendererPar.yy @@ -0,0 +1,31 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oRendererPar", + "spriteId": null, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "Example", + "path": "folders/Example.yy", + }, +} \ No newline at end of file diff --git a/objects/oShadowOverlay/Create_0.gml b/objects/oShadowOverlay/Create_0.gml index 8439b79..3e0577d 100644 --- a/objects/oShadowOverlay/Create_0.gml +++ b/objects/oShadowOverlay/Create_0.gml @@ -1,4 +1,4 @@ -shadow = new BulbShadowOverlay(oRenderer.lighting); +shadow = new BulbShadowOverlay(oRendererPar.renderer); shadow.sprite = sprite_index; shadow.x = x; shadow.y = y; diff --git a/objects/oStaticOccluder/Create_0.gml b/objects/oStaticOccluder/Create_0.gml index d81c67c..fe91e6d 100644 --- a/objects/oStaticOccluder/Create_0.gml +++ b/objects/oStaticOccluder/Create_0.gml @@ -1,10 +1,9 @@ -occluder = new BulbStaticOccluder(oRenderer.lighting); +occluder = new BulbStaticOccluder(oRendererPar.renderer); occluder.x = x; occluder.y = y; occluder.xscale = image_xscale; occluder.yscale = image_yscale; occluder.angle = image_angle; -occluder.AddToRenderer(oRenderer.vision); var _l = -0.5*sprite_get_width(sprite_index); var _t = -0.5*sprite_get_height(sprite_index); diff --git a/objects/oStaticOccluder3/Create_0.gml b/objects/oStaticOccluder3/Create_0.gml index e349907..8f3b442 100644 --- a/objects/oStaticOccluder3/Create_0.gml +++ b/objects/oStaticOccluder3/Create_0.gml @@ -1,4 +1,4 @@ -occluder = new BulbStaticOccluder(oRenderer3.lighting); +occluder = new BulbStaticOccluder(oRenderer3.renderer); occluder.x = x; occluder.y = y; occluder.xscale = image_xscale; diff --git a/objects/oStaticOccluder3/oStaticOccluder3.yy b/objects/oStaticOccluder3/oStaticOccluder3.yy index bbb7fe6..3c0d8e3 100644 --- a/objects/oStaticOccluder3/oStaticOccluder3.yy +++ b/objects/oStaticOccluder3/oStaticOccluder3.yy @@ -1,10 +1,14 @@ { + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oStaticOccluder3", "spriteId": { "name": "sStaticBlock", "path": "sprites/sStaticBlock/sStaticBlock.yy", }, "solid": false, "visible": false, + "managed": true, "spriteMaskId": null, "persistent": false, "parentObjectId": null, @@ -21,7 +25,7 @@ "physicsKinematic": false, "physicsShapePoints": [], "eventList": [ - {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, ], "properties": [], "overriddenProperties": [], @@ -29,8 +33,4 @@ "name": "rmTestSoft", "path": "folders/Example/rmTestSoft.yy", }, - "resourceVersion": "1.0", - "name": "oStaticOccluder3", - "tags": [], - "resourceType": "GMObject", } \ No newline at end of file diff --git a/objects/oSunlight/CleanUp_0.gml b/objects/oSunlight/CleanUp_0.gml new file mode 100644 index 0000000..790c9cd --- /dev/null +++ b/objects/oSunlight/CleanUp_0.gml @@ -0,0 +1 @@ +sunlight.Destroy(); \ No newline at end of file diff --git a/objects/oSunlight/Create_0.gml b/objects/oSunlight/Create_0.gml new file mode 100644 index 0000000..89c7ee0 --- /dev/null +++ b/objects/oSunlight/Create_0.gml @@ -0,0 +1,8 @@ +sunlight = new BulbSunlight(oRendererPar.renderer, 45); +sunlight.blend = c_red; +sunlight.intensity = 1; +sunlight.penumbraSize = 5; + +//Turn on normal maps for this light +//This would typically be done using the `BULB_DEFAULT_USE_NORMAL_MAP` +sunlight.normalMap = true; \ No newline at end of file diff --git a/objects/oSunlight/Step_0.gml b/objects/oSunlight/Step_0.gml new file mode 100644 index 0000000..2015987 --- /dev/null +++ b/objects/oSunlight/Step_0.gml @@ -0,0 +1 @@ +sunlight.angle += 0.1; \ No newline at end of file diff --git a/objects/oSunlight/oSunlight.yy b/objects/oSunlight/oSunlight.yy new file mode 100644 index 0000000..779e715 --- /dev/null +++ b/objects/oSunlight/oSunlight.yy @@ -0,0 +1,35 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "oSunlight", + "spriteId": null, + "solid": false, + "visible": true, + "managed": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":12,"collisionObjectId":null,}, + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "rmTest Objects", + "path": "folders/Example/rmTest Objects.yy", + }, +} \ No newline at end of file diff --git a/options/amazonfire/options_amazonfire.yy b/options/amazonfire/options_amazonfire.yy index c4b6d7d..a5ba6ba 100644 --- a/options/amazonfire/options_amazonfire.yy +++ b/options/amazonfire/options_amazonfire.yy @@ -1,49 +1,50 @@ { - "option_amazonfire_sync_android": false, - "option_amazonfire_display_name": "Created with GameMaker Studio 2", - "option_amazonfire_version": "1.0.0.0", - "option_amazonfire_tools_from_version": false, - "option_amazonfire_build_tools": "", - "option_amazonfire_support_lib": "", - "option_amazonfire_target_sdk": "", - "option_amazonfire_minimum_sdk": "", - "option_amazonfire_compile_sdk": "", - "option_amazonfire_package_domain": "com", - "option_amazonfire_package_company": "company", - "option_amazonfire_package_product": "game", - "option_amazonfire_orient_portrait": true, - "option_amazonfire_orient_portrait_flipped": true, - "option_amazonfire_orient_landscape": true, - "option_amazonfire_orient_landscape_flipped": true, - "option_amazonfire_gamepad_support": true, - "option_amazonfire_lint": false, - "option_amazonfire_install_location": 0, - "option_amazonfire_sleep_margin": 4, - "option_amazonfire_splash_screens_landscape": "${base_options_dir}/amazonfire/splash/landscape.png", - "option_amazonfire_splash_screens_portrait": "${base_options_dir}/amazonfire/splash/portrait.png", - "option_amazonfire_splash_time": 0, - "option_amazonfire_launchscreen_fill": 0, - "option_amazonfire_splashscreen_background_colour": 255, - "option_amazonfire_tv_banner": "${base_options_dir}/amazonfire/tv_banner.png", - "option_amazonfire_interpolate_pixels": false, - "option_amazonfire_screen_depth": 0, - "option_amazonfire_scale": 0, - "option_amazonfire_texture_page": "2048x2048", - "option_amazonfire_icon_ldpi": "${base_options_dir}/android/icons/ldpi.png", - "option_amazonfire_icon_mdpi": "${base_options_dir}/android/icons/mdpi.png", - "option_amazonfire_icon_hdpi": "${base_options_dir}/android/icons/hdpi.png", - "option_amazonfire_icon_xhdpi": "${base_options_dir}/android/icons/xhdpi.png", - "option_amazonfire_icon_xxhdpi": "${base_options_dir}/android/icons/xxhdpi.png", - "option_amazonfire_icon_xxxhdpi": "${base_options_dir}/android/icons/xxxhdpi.png", - "option_amazonfire_permission_write_external_storage": false, - "option_amazonfire_permission_read_phone_state": false, - "option_amazonfire_permission_network_state": false, - "option_amazonfire_permission_internet": true, - "option_amazonfire_permission_bluetooth": true, - "option_amazonfire_permission_record_audio": false, - "option_amazonfire_application_tag_inject": "", - "resourceVersion": "1.0", - "name": "Amazon Fire", - "tags": [], - "resourceType": "GMAmazonFireOptions", + "$GMAmazonFireOptions":"", + "%Name":"Amazon Fire", + "name":"Amazon Fire", + "option_amazonfire_application_tag_inject":"", + "option_amazonfire_build_tools":"", + "option_amazonfire_compile_sdk":"", + "option_amazonfire_display_name":"Created with GameMaker Studio 2", + "option_amazonfire_gamepad_support":true, + "option_amazonfire_icon_hdpi":"${base_options_dir}/android/icons/hdpi.png", + "option_amazonfire_icon_ldpi":"${base_options_dir}/android/icons/ldpi.png", + "option_amazonfire_icon_mdpi":"${base_options_dir}/android/icons/mdpi.png", + "option_amazonfire_icon_xhdpi":"${base_options_dir}/android/icons/xhdpi.png", + "option_amazonfire_icon_xxhdpi":"${base_options_dir}/android/icons/xxhdpi.png", + "option_amazonfire_icon_xxxhdpi":"${base_options_dir}/android/icons/xxxhdpi.png", + "option_amazonfire_install_location":0, + "option_amazonfire_interpolate_pixels":false, + "option_amazonfire_launchscreen_fill":0, + "option_amazonfire_lint":false, + "option_amazonfire_minimum_sdk":"", + "option_amazonfire_orient_landscape":true, + "option_amazonfire_orient_landscape_flipped":true, + "option_amazonfire_orient_portrait":true, + "option_amazonfire_orient_portrait_flipped":true, + "option_amazonfire_package_company":"company", + "option_amazonfire_package_domain":"com", + "option_amazonfire_package_product":"game", + "option_amazonfire_permission_bluetooth":true, + "option_amazonfire_permission_internet":true, + "option_amazonfire_permission_network_state":false, + "option_amazonfire_permission_read_phone_state":false, + "option_amazonfire_permission_record_audio":false, + "option_amazonfire_permission_write_external_storage":false, + "option_amazonfire_scale":0, + "option_amazonfire_screen_depth":0, + "option_amazonfire_sleep_margin":4, + "option_amazonfire_splashscreen_background_colour":255, + "option_amazonfire_splash_screens_landscape":"${base_options_dir}/amazonfire/splash/landscape.png", + "option_amazonfire_splash_screens_portrait":"${base_options_dir}/amazonfire/splash/portrait.png", + "option_amazonfire_splash_time":0, + "option_amazonfire_support_lib":"", + "option_amazonfire_sync_android":false, + "option_amazonfire_target_sdk":"", + "option_amazonfire_texture_page":"2048x2048", + "option_amazonfire_tools_from_version":false, + "option_amazonfire_tv_banner":"${base_options_dir}/amazonfire/tv_banner.png", + "option_amazonfire_version":"1.0.0.0", + "resourceType":"GMAmazonFireOptions", + "resourceVersion":"2.0", } \ No newline at end of file diff --git a/options/android/options_android.yy b/options/android/options_android.yy index 6e20c08..a5d2f1d 100644 --- a/options/android/options_android.yy +++ b/options/android/options_android.yy @@ -1,6 +1,9 @@ { + "resourceType": "GMAndroidOptions", + "resourceVersion": "1.0", + "name": "Android", "option_android_sync_amazon": false, - "option_android_display_name": "Made in GameMaker Studio 2", + "option_android_display_name": "Created with GameMaker", "option_android_version": "1.0.0.0", "option_android_tools_from_version": false, "option_android_build_tools": "", @@ -11,9 +14,8 @@ "option_android_package_domain": "com", "option_android_package_company": "company", "option_android_package_product": "game", - "option_android_arch_armv7": true, - "option_android_arch_x86": false, - "option_android_arch_arm64": false, + "option_android_arch_armv7": false, + "option_android_arch_arm64": true, "option_android_arch_x86_64": false, "option_android_orient_portrait": true, "option_android_orient_portrait_flipped": true, @@ -27,7 +29,7 @@ "option_android_splash_screens_portrait": "${base_options_dir}/android/splash/portrait.png", "option_android_splash_time": 0, "option_android_launchscreen_fill": 0, - "option_android_splashscreen_background_colour": 4294967295, + "option_android_splashscreen_background_colour": 255, "option_android_tv_banner": "${base_options_dir}/android/tv_banner.png", "option_android_interpolate_pixels": false, "option_android_screen_depth": 0, @@ -62,15 +64,15 @@ "option_android_permission_read_phone_state": false, "option_android_permission_network_state": false, "option_android_permission_internet": true, - "option_android_permission_bluetooth": false, + "option_android_permission_bluetooth": true, "option_android_permission_record_audio": false, - "option_android_application_tag_inject": null, + "option_android_application_tag_inject": "", + "option_android_attribute_allow_backup": false, "option_android_google_apk_expansion": false, "option_android_google_dynamic_asset_delivery": false, "option_android_google_licensing_public_key": "", "option_android_tv_isgame": true, - "resourceVersion": "1.0", - "name": "Android", - "tags": [], - "resourceType": "GMAndroidOptions", + "option_android_tv_supports_leanback": true, + "option_android_proguard_minifying": false, + "option_android_proguard_shrinking": false, } \ No newline at end of file diff --git a/options/html5/options_html5.yy b/options/html5/options_html5.yy index a6a7477..e9ba8bc 100644 --- a/options/html5/options_html5.yy +++ b/options/html5/options_html5.yy @@ -1,22 +1,25 @@ { - "option_html5_browser_title": "Created with GameMaker: Studio", + "resourceType": "GMHtml5Options", + "resourceVersion": "1.0", + "name": "HTML5", + "option_html5_browser_title": "Created with GameMaker", "option_html5_version": "1.0.0.0", "option_html5_foldername": "html5game", "option_html5_outputname": "index.html", - "option_html5_splash_png": "${options_dir}/html5/splash.png", + "option_html5_splash_png": "${base_options_dir}/html5/splash.png", "option_html5_usesplash": false, "option_html5_outputdebugtoconsole": true, "option_html5_display_cursor": true, "option_html5_localrunalert": true, - "option_html5_index": "use_default", - "option_html5_loadingbar": "-1", + "option_html5_index": "", + "option_html5_loadingbar": "", "option_html5_jsprepend": "", - "option_html5_icon": "${options_dir}/html5/fav.ico", + "option_html5_icon": "${base_options_dir}/html5/fav.ico", "option_html5_allow_fullscreen": true, "option_html5_interpolate_pixels": true, "option_html5_centregame": false, "option_html5_usebuiltinparticles": true, - "option_html5_usebuiltinfont": false, + "option_html5_usebuiltinfont": true, "option_html5_webgl": 2, "option_html5_scale": 0, "option_html5_texture_page": "2048x2048", @@ -27,8 +30,4 @@ "option_html5_flurry_id": "", "option_html5_google_analytics_enable": false, "option_html5_google_tracking_id": "", - "resourceVersion": "1.0", - "name": "HTML5", - "tags": [], - "resourceType": "GMHtml5Options", } \ No newline at end of file diff --git a/options/ios/options_ios.yy b/options/ios/options_ios.yy index a29fed7..64c726b 100644 --- a/options/ios/options_ios.yy +++ b/options/ios/options_ios.yy @@ -1,9 +1,14 @@ { - "option_ios_display_name": "Made in GameMaker Studio 2", + "resourceType": "GMiOSOptions", + "resourceVersion": "1.3", + "name": "iOS", + "option_ios_display_name": "Created with GameMaker", "option_ios_bundle_name": "com.company.game", "option_ios_version": "1.0.0.0", - "option_ios_output_dir": "~/GameMakerStudio2/iOS", + "option_ios_output_dir": "~/gamemakerstudio2", "option_ios_team_id": "", + "option_ios_min_version": "10.0", + "option_ios_cocoapods_checkbox": true, "option_ios_orientation_portrait": true, "option_ios_orientation_portrait_flipped": true, "option_ios_orientation_landscape": true, @@ -28,7 +33,7 @@ "option_ios_icon_ipad_settings_29": "${base_options_dir}/ios/icons/settings/ipad_29.png", "option_ios_icon_ipad_settings_58": "${base_options_dir}/ios/icons/settings/ipad_58.png", "option_ios_icon_itunes_artwork_1024": "${base_options_dir}/ios/icons/itunes/itunes_1024.png", - "option_ios_splashscreen_background_colour": 4294967295, + "option_ios_splashscreen_background_colour": 255, "option_ios_launchscreen_image": "${base_options_dir}/ios/splash/launchscreen.png", "option_ios_launchscreen_image_landscape": "${base_options_dir}/ios/splash/launchscreen-landscape.png", "option_ios_launchscreen_fill": 0, @@ -36,15 +41,6 @@ "option_ios_half_ipad1_textures": false, "option_ios_scale": 0, "option_ios_texture_page": "2048x2048", - "option_ios_use_facebook": false, - "option_ios_facebook_id": "", - "option_ios_facebook_app_display_name": "", - "option_ios_push_notifications": false, - "option_ios_apple_sign_in": false, "option_ios_podfile_path": "${options_dir}/ios/Podfile", "option_ios_podfile_lock_path": "${options_dir}/ios/Podfile.lock", - "resourceVersion": "1.3", - "name": "iOS", - "tags": [], - "resourceType": "GMiOSOptions", } \ No newline at end of file diff --git a/options/linux/options_linux.yy b/options/linux/options_linux.yy index e8a6adc..d3575b0 100644 --- a/options/linux/options_linux.yy +++ b/options/linux/options_linux.yy @@ -1,25 +1,24 @@ { - "option_linux_display_name": "myAttemptAtShadowsV3", + "resourceType": "GMLinuxOptions", + "resourceVersion": "1.0", + "name": "Linux", + "option_linux_display_name": "Created with GameMaker", "option_linux_version": "1.0.0.0", "option_linux_maintainer_email": "", - "option_linux_homepage": "http://www.myAttemptAtShadowsV3.com", - "option_linux_short_desc": "myAttemptAtShadowsV3", - "option_linux_long_desc": "myAttemptAtShadowsV3", - "option_linux_splash_screen": "${options_dir}/linux/splash/splash.png", + "option_linux_homepage": "http://www.yoyogames.com", + "option_linux_short_desc": "", + "option_linux_long_desc": "", + "option_linux_splash_screen": "${base_options_dir}/linux/splash/splash.png", "option_linux_display_splash": false, - "option_linux_icon": "${options_dir}/linux/icons/icon64.png", + "option_linux_icon": "${base_options_dir}/linux/icons/64.png", "option_linux_start_fullscreen": false, - "option_linux_allow_fullscreen": true, - "option_linux_interpolate_pixels": false, - "option_linux_display_cursor": false, + "option_linux_allow_fullscreen": false, + "option_linux_interpolate_pixels": true, + "option_linux_display_cursor": true, "option_linux_sync": false, "option_linux_resize_window": false, "option_linux_scale": 0, "option_linux_texture_page": "2048x2048", "option_linux_enable_steam": false, "option_linux_disable_sandbox": false, - "resourceVersion": "1.0", - "name": "Linux", - "tags": [], - "resourceType": "GMLinuxOptions", } \ No newline at end of file diff --git a/options/mac/options_mac.yy b/options/mac/options_mac.yy index 530f57a..cd91596 100644 --- a/options/mac/options_mac.yy +++ b/options/mac/options_mac.yy @@ -1,32 +1,35 @@ { - "option_mac_display_name": "myAttemptAtShadowsV3", - "option_mac_app_id": "", + "resourceType": "GMMacOptions", + "resourceVersion": "1.0", + "name": "macOS", + "option_mac_display_name": "Created with GameMaker", + "option_mac_app_id": "com.company.game", "option_mac_version": "1.0.0.0", - "option_mac_output_dir": "~/GameMaker-Studio/myAttemptAtShadowsV3", - "option_mac_team_id": null, + "option_mac_output_dir": "~/gamemakerstudio2", + "option_mac_team_id": "", "option_mac_signing_identity": "Developer ID Application:", - "option_mac_copyright": "(c)2012 CompanyName Ltd...", - "option_mac_splash_png": "${options_dir}/mac/splash/splash.png", - "option_mac_icon_png": "${options_dir}/mac/icons/icon512.png", + "option_mac_copyright": "", + "option_mac_splash_png": "${base_options_dir}/mac/splash/splash.png", + "option_mac_icon_png": "${base_options_dir}/mac/icons/1024.png", + "option_mac_installer_background_png": "${base_options_dir}/mac/splash/installer_background.png", "option_mac_menu_dock": false, "option_mac_display_cursor": true, "option_mac_start_fullscreen": false, - "option_mac_allow_fullscreen": true, - "option_mac_interpolate_pixels": false, + "option_mac_allow_fullscreen": false, + "option_mac_interpolate_pixels": true, "option_mac_vsync": false, "option_mac_resize_window": false, "option_mac_enable_retina": false, "option_mac_scale": 0, "option_mac_texture_page": "2048x2048", - "option_mac_build_app_store": true, + "option_mac_build_app_store": false, "option_mac_allow_incoming_network": false, "option_mac_allow_outgoing_network": false, "option_mac_app_category": "Games", "option_mac_enable_steam": false, "option_mac_disable_sandbox": false, + "option_mac_x86_64": true, + "option_mac_arm64": true, "option_mac_apple_sign_in": false, - "resourceVersion": "1.0", - "name": "macOS", - "tags": [], - "resourceType": "GMMacOptions", + "option_mac_min_version": "10.10", } \ No newline at end of file diff --git a/options/main/options_main.yy b/options/main/options_main.yy index 9a3c5c3..8fcebf7 100644 --- a/options/main/options_main.yy +++ b/options/main/options_main.yy @@ -1,5 +1,8 @@ { - "option_gameguid": "{57B0990D-6BFA-4909-9726-0CD623759034}", + "resourceType": "GMMainOptions", + "resourceVersion": "1.4", + "name": "Main", + "option_gameguid": "ed3c2e73-989e-466b-9abf-9dea70f8a945", "option_gameid": "0", "option_game_speed": 60, "option_mips_for_3d_textures": false, @@ -8,15 +11,10 @@ "option_steam_app_id": "0", "option_sci_usesci": false, "option_author": "", - "option_collision_compatibility": true, - "option_copy_on_write_enabled": true, - "option_lastchanged": "", + "option_collision_compatibility": false, + "option_copy_on_write_enabled": false, "option_spine_licence": false, "option_template_image": "${base_options_dir}/main/template_image.png", "option_template_icon": "${base_options_dir}/main/template_icon.png", "option_template_description": null, - "resourceVersion": "1.4", - "name": "Main", - "tags": [], - "resourceType": "GMMainOptions", } \ No newline at end of file diff --git a/options/operagx/options_operagx.yy b/options/operagx/options_operagx.yy index 2cf254e..9571f96 100644 --- a/options/operagx/options_operagx.yy +++ b/options/operagx/options_operagx.yy @@ -1,4 +1,7 @@ { + "resourceType": "GMOperaGXOptions", + "resourceVersion": "1.0", + "name": "operagx", "option_operagx_version": "1.0.0.0", "option_operagx_next_version": "1.0.0.0", "option_operagx_game_name": "${project_name}", @@ -8,11 +11,8 @@ "option_operagx_display_cursor": true, "option_operagx_guid": "", "option_operagx_team_name": "", + "option_operagx_team_id": "", "option_operagx_editUrl": "", "option_operagx_internalShareUrl": "", "option_operagx_publicShareUrl": "", - "resourceVersion": "1.0", - "name": "operagx", - "tags": [], - "resourceType": "GMOperaGXOptions", } \ No newline at end of file diff --git a/options/ps4/options_ps4.yy b/options/ps4/options_ps4.yy index a8f609e..18930c3 100644 --- a/options/ps4/options_ps4.yy +++ b/options/ps4/options_ps4.yy @@ -1,36 +1,37 @@ { - "option_ps4_package_id": "IV0002-NPXS29129_00-APP0990000000022", - "option_ps4_passcode": "GvE6xCpZxd96scOUGuLPbuLp8O800B0s", - "option_ps4_nptitleid": "", - "option_ps4_nptitlesecret": "", - "option_ps4_paramsfo": "0", - "option_ps4_nptitledat": "", - "option_ps4_trophyedit": "0", - "option_ps4_shareparam": "", - "option_ps4_pronunciation": "", - "option_ps4_splash_screen": "${base_options_dir}/ps4/sce_sys/pic1.png", - "option_ps4_save_data_icon": "${base_options_dir}/ps4/sce_sys/save_data.png", - "option_ps4_trophy_screen": "${base_options_dir}/ps4/sce_sys/pic0.png", - "option_ps4_interpolate_pixels": false, - "option_ps4_display_cursor": false, - "option_ps4_scale": 0, - "option_ps4_texture_page": "2048x2048", - "option_ps4_max_display_width": -1, - "option_ps4_max_display_height": -1, - "option_ps4_icon": "${base_options_dir}/ps4/sce_sys/icon0.png", - "option_ps4_shareoverlay_image": "${base_options_dir}/ps4/sce_sys/shareoverlayimage.png", - "option_ps4_nptitledat_file": "${options_dir}\\ps4\\sce_sys\\nptitle.dat", - "option_ps4_paramsfo_file": "${options_dir}\\ps4\\sce_sys\\param.sfo", - "option_ps4_trophy00trp_file": "${options_dir}\\ps4\\sce_sys\\trophy\\trophy00.trp", - "option_ps4_shareparam_file": "${options_dir}\\ps4\\sce_sys\\shareparam.json", - "option_ps4_pronunciation_file": "${options_dir}\\ps4\\sce_sys\\pronunciation.xml", - "option_ps4_pronunciation_sig": "${options_dir}\\ps4\\sce_sys\\pronunciation.sig", - "option_ps4_onion": 2048, - "option_ps4_garlic": 1024, - "option_ps4_neo_onion": 2048, - "option_ps4_neo_garlic": 1536, - "resourceVersion": "1.0", - "name": "PlayStation 4", - "tags": [], - "resourceType": "GMPS4Options", + "$GMPS4Options":"", + "%Name":"PlayStation 4", + "name":"PlayStation 4", + "option_ps4_display_cursor":false, + "option_ps4_garlic":1024, + "option_ps4_icon":"${base_options_dir}/ps4/sce_sys/icon0.png", + "option_ps4_interpolate_pixels":false, + "option_ps4_max_display_height":-1, + "option_ps4_max_display_width":-1, + "option_ps4_neo_garlic":1536, + "option_ps4_neo_onion":2048, + "option_ps4_nptitledat":"", + "option_ps4_nptitledat_file":"${options_dir}\\ps4\\sce_sys\\nptitle.dat", + "option_ps4_nptitleid":"", + "option_ps4_nptitlesecret":"", + "option_ps4_onion":2048, + "option_ps4_package_id":"IV0002-NPXS29129_00-APP0990000000022", + "option_ps4_paramsfo":"${options_dir}/ps4/0", + "option_ps4_paramsfo_file":"${options_dir}\\ps4\\sce_sys\\param.sfo", + "option_ps4_passcode":"GvE6xCpZxd96scOUGuLPbuLp8O800B0s", + "option_ps4_pronunciation":"", + "option_ps4_pronunciation_file":"${options_dir}\\ps4\\sce_sys\\pronunciation.xml", + "option_ps4_pronunciation_sig":"${options_dir}\\ps4\\sce_sys\\pronunciation.sig", + "option_ps4_save_data_icon":"${base_options_dir}/ps4/sce_sys/save_data.png", + "option_ps4_scale":0, + "option_ps4_shareoverlay_image":"${base_options_dir}/ps4/sce_sys/shareoverlayimage.png", + "option_ps4_shareparam":"", + "option_ps4_shareparam_file":"${options_dir}\\ps4\\sce_sys\\shareparam.json", + "option_ps4_splash_screen":"${base_options_dir}/ps4/sce_sys/pic1.png", + "option_ps4_texture_page":"2048x2048", + "option_ps4_trophy00trp_file":"${options_dir}\\ps4\\sce_sys\\trophy\\trophy00.trp", + "option_ps4_trophyedit":"${options_dir}/ps4/0", + "option_ps4_trophy_screen":"${base_options_dir}/ps4/sce_sys/pic0.png", + "resourceType":"GMPS4Options", + "resourceVersion":"2.0", } \ No newline at end of file diff --git a/options/switch/options_switch.yy b/options/switch/options_switch.yy index a3bd2ca..4ff05e0 100644 --- a/options/switch/options_switch.yy +++ b/options/switch/options_switch.yy @@ -1,16 +1,19 @@ { - "option_switch_project_nmeta": "${options_dir}/switch/application.nmeta", - "option_switch_enable_nex_libraries": false, - "option_switch_interpolate_pixels": true, - "option_switch_scale": 0, - "option_switch_texture_page": "2048x2048", - "option_switch_check_nsp_publish_errors": true, - "option_switch_enable_fileaccess_checking": true, - "option_switch_splash_screen": "${base_options_dir}/switch/splash.png", - "option_switch_use_splash": false, - "option_switch_allow_debug_output": false, - "resourceVersion": "1.0", - "name": "Switch", - "tags": [], - "resourceType": "GMSwitchOptions", + "$GMSwitchOptions":"", + "%Name":"Switch", + "name":"Switch", + "option_switch_allow_debug_output":false, + "option_switch_check_nsp_publish_errors":true, + "option_switch_enable_fileaccess_checking":true, + "option_switch_enable_nex_libraries":false, + "option_switch_enable_npln_libraries":false, + "option_switch_gfx_mem_mb":256, + "option_switch_interpolate_pixels":true, + "option_switch_project_nmeta":"${options_dir}/switch/application.nmeta", + "option_switch_scale":0, + "option_switch_splash_screen":"${base_options_dir}/switch/splash.png", + "option_switch_texture_page":"2048x2048", + "option_switch_use_splash":false, + "resourceType":"GMSwitchOptions", + "resourceVersion":"2.0", } \ No newline at end of file diff --git a/options/tvos/options_tvos.yy b/options/tvos/options_tvos.yy index 275eb09..4dca9da 100644 --- a/options/tvos/options_tvos.yy +++ b/options/tvos/options_tvos.yy @@ -1,9 +1,14 @@ { - "option_tvos_display_name": "Made in GameMaker Studio 2", + "resourceType": "GMtvOSOptions", + "resourceVersion": "1.3", + "name": "tvOS", + "option_tvos_display_name": "Made in GameMaker", "option_tvos_bundle_name": "com.company.game", "option_tvos_version": "1.0.0.0", "option_tvos_output_dir": "~/GameMakerStudio2/tvOS", "option_tvos_team_id": "", + "option_tvos_min_version": "10.0", + "option_tvos_cocoapods_checkbox": true, "option_tvos_icon_400": "${base_options_dir}/tvos/icons/400.png", "option_tvos_icon_400_2x": "${base_options_dir}/tvos/icons/400_2x.png", "option_tvos_icon_1280": "${base_options_dir}/tvos/icons/1280.png", @@ -13,17 +18,11 @@ "option_tvos_topshelf_wide_2x": "${base_options_dir}/tvos/topshelf/topshelf_wide_2x.png", "option_tvos_splashscreen": "${base_options_dir}/tvos/splash/splash.png", "option_tvos_splashscreen_2x": "${base_options_dir}/tvos/splash/splash_2x.png", - "option_tvos_splash_time": 10, + "option_tvos_splash_time": 0, "option_tvos_interpolate_pixels": true, "option_tvos_scale": 0, "option_tvos_texture_page": "2048x2048", "option_tvos_display_cursor": false, - "option_tvos_push_notifications": false, - "option_tvos_apple_sign_in": false, "option_tvos_podfile_path": "${options_dir}\\tvos\\Podfile", "option_tvos_podfile_lock_path": "${options_dir}\\tvos\\Podfile.lock", - "resourceVersion": "1.3", - "name": "tvOS", - "tags": [], - "resourceType": "GMtvOSOptions", } \ No newline at end of file diff --git a/options/windows/options_windows.yy b/options/windows/options_windows.yy index 7e98532..7572d7e 100644 --- a/options/windows/options_windows.yy +++ b/options/windows/options_windows.yy @@ -3,16 +3,16 @@ "resourceVersion": "1.1", "name": "Windows", "option_windows_display_name": "Bulb", - "option_windows_executable_name": "${project_name}", - "option_windows_version": "21.0.1.0", + "option_windows_executable_name": "${project_name}.exe", + "option_windows_version": "22.0.7.0", "option_windows_company_info": "Juju Adams", "option_windows_product_info": "Bulb", - "option_windows_copyright_info": "Juju Adams (c) 2023", + "option_windows_copyright_info": "Juju Adams (c) 2024", "option_windows_description_info": "Bulb", "option_windows_display_cursor": true, - "option_windows_icon": "${options_dir}/windows/runner_icon.ico", + "option_windows_icon": "${base_options_dir}/windows/icons/icon.ico", "option_windows_save_location": 0, - "option_windows_splash_screen": "${options_dir}/windows/splash.png", + "option_windows_splash_screen": "${base_options_dir}/windows/splash/splash.png", "option_windows_use_splash": false, "option_windows_start_fullscreen": false, "option_windows_allow_fullscreen_switching": false, @@ -24,10 +24,10 @@ "option_windows_copy_exe_to_dest": false, "option_windows_sleep_margin": 10, "option_windows_texture_page": "2048x2048", - "option_windows_installer_finished": "${options_dir}/windows/Runner_finish.bmp", - "option_windows_installer_header": "${options_dir}/windows/Runner_header.bmp", - "option_windows_license": "${options_dir}/windows/installer/license.txt", - "option_windows_nsis_file": "${options_dir}/windows/installer/runnerinstaller.nsi", + "option_windows_installer_finished": "${base_options_dir}/windows/installer/finished.bmp", + "option_windows_installer_header": "${base_options_dir}/windows/installer/header.bmp", + "option_windows_license": "${base_options_dir}/windows/installer/license.txt", + "option_windows_nsis_file": "${base_options_dir}/windows/installer/nsis_script.nsi", "option_windows_enable_steam": false, "option_windows_disable_sandbox": false, "option_windows_steam_use_alternative_launcher": false, diff --git a/rooms/rmInit/rmInit.yy b/rooms/rmInit/rmInit.yy index 453fa0a..c04aa0e 100644 --- a/rooms/rmInit/rmInit.yy +++ b/rooms/rmInit/rmInit.yy @@ -18,8 +18,8 @@ "layers": [ {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Instances","instances":[ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_408F6C15","properties":[],"isDnd":false,"objectId":{"name":"oInit","path":"objects/oInit/oInit.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":0.0,"y":0.0,}, - ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, - {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":null,"colour":4278190080,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, + ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, + {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":null,"colour":4278190080,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, ], "inheritLayers": false, "creationCodeFile": "", diff --git a/rooms/rmTest/rmTest.yy b/rooms/rmTest/rmTest.yy index ad54c5f..c9f7098 100644 --- a/rooms/rmTest/rmTest.yy +++ b/rooms/rmTest/rmTest.yy @@ -19,13 +19,14 @@ {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Player_And_Renderer","instances":[ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_1C9E5E16","properties":[],"isDnd":false,"objectId":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1847.0,"y":1780.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_540AE204","properties":[],"isDnd":false,"objectId":{"name":"oRenderer","path":"objects/oRenderer/oRenderer.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":32.0,"y":32.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7E49EC20","properties":[],"isDnd":false,"objectId":{"name":"oSunlight","path":"objects/oSunlight/oSunlight.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":96.0,"y":32.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_5FF3F20B","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2016.0,"y":1152.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_C98ECDA","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1984.0,"y":1216.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_F2A1CC6","properties":[],"isDnd":false,"objectId":{"name":"oCircularOccluder","path":"objects/oCircularOccluder/oCircularOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2304.0,"y":1632.0,}, ],"visible":true,"depth":-99,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Lights","instances":[ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_306B3BD4","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2418.0,"y":1918.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_15A748A0","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2122.0,"y":1945.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_B958069","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2240.0,"y":1707.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_B72B666","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2077.0,"y":1603.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_2471C1B4","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1851.0,"y":1719.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_503B1B61","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2231.0,"y":2147.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_28641F6C","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1750.0,"y":2275.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_3ECDE99","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2112.0,"y":1363.0,}, @@ -33,16 +34,17 @@ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_435ACC28","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2545.0,"y":1257.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_1CDD8FEB","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1254.0,"y":1558.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_6EA6DA76","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1251.0,"y":1848.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_410738E","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1516.0,"y":1565.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_173256E6","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1474.0,"y":1431.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7FB2E033","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1950.0,"y":1177.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_348D6982","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1540.0,"y":1296.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_6A5EADD6","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1729.0,"y":1545.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_3911E36","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1859.0,"y":2025.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_29E30185","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1583.0,"y":1957.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_43D03A9C","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1325.0,"y":2426.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_1D6EE29B","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1847.0,"y":2581.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7C990895","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo","path":"objects/oLightDiscoooo/oLightDiscoooo.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2429.0,"y":2678.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_1A6C9662","properties":[],"isDnd":false,"objectId":{"name":"oEmissive","path":"objects/oEmissive/oEmissive.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1344.0,"y":2784.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_6F66C9A6","properties":[],"isDnd":false,"objectId":{"name":"oEmissive","path":"objects/oEmissive/oEmissive.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1472.0,"y":2784.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7289D808","properties":[],"isDnd":false,"objectId":{"name":"oEmissive","path":"objects/oEmissive/oEmissive.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1472.0,"y":2656.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_8CE4907","properties":[],"isDnd":false,"objectId":{"name":"oEmissive","path":"objects/oEmissive/oEmissive.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1344.0,"y":2656.0,}, ],"visible":true,"depth":-199,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Occluders","instances":[ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_652D8356","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1568.0,"y":1696.0,}, @@ -525,8 +527,6 @@ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_77295BCC","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":29.0,"scaleX":0.84,"scaleY":2.967742,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1527.0,"y":1451.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_40BD321C","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":27.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1525.0,"y":1346.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_4E6559A4","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1898.0,"y":1438.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_6EF7F598","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1372.0,"y":2642.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_20D755C2","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1511.0,"y":2808.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_183FAA12","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1600.0,"y":2633.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_67CB4AD4","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1784.0,"y":2653.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_A0E4069","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1697.0,"y":2847.0,}, @@ -544,12 +544,13 @@ {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_2E15EFEA","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2006.0,"y":2783.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_5642DBBC","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2423.0,"y":2856.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_6E6AA13F","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder","path":"objects/oDynamicOccluder/oDynamicOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2617.0,"y":2616.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_4AE0B63","properties":[],"isDnd":false,"objectId":{"name":"oPyramid","path":"objects/oPyramid/oPyramid.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1856.0,"y":1984.0,}, ],"visible":true,"depth":0,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Overlays_And_Underlays","instances":[ - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_431637D2","properties":[],"isDnd":false,"objectId":{"name":"oAmbientUnderlay","path":"objects/oAmbientUnderlay/oAmbientUnderlay.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1824.0,"y":1152.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_431637D2","properties":[],"isDnd":false,"objectId":{"name":"oAmbientUnderlay","path":"objects/oAmbientUnderlay/oAmbientUnderlay.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1056.0,"y":1632.0,}, {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_4540865C","properties":[],"isDnd":false,"objectId":{"name":"oShadowOverlay","path":"objects/oShadowOverlay/oShadowOverlay.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1216.0,"y":1184.0,}, ],"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, - {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":null,"colour":4293256677,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":2147483600,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, + {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":{"name":"sFloorTexture","path":"sprites/sFloorTexture/sFloorTexture.yy",},"colour":4294967295,"x":0,"y":0,"htiled":true,"vtiled":true,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":30.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":2147483600,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, ], "inheritLayers": false, "creationCodeFile": "", @@ -558,10 +559,7 @@ {"name":"inst_540AE204","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_1C9E5E16","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_306B3BD4","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_15A748A0","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_B958069","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_B72B666","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_2471C1B4","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_503B1B61","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_28641F6C","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_3ECDE99","path":"rooms/rmTest/rmTest.yy",}, @@ -569,14 +567,11 @@ {"name":"inst_435ACC28","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_1CDD8FEB","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_6EA6DA76","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_410738E","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_173256E6","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_7FB2E033","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_348D6982","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_6A5EADD6","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_3911E36","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_29E30185","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_43D03A9C","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_1D6EE29B","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_7C990895","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_652D8356","path":"rooms/rmTest/rmTest.yy",}, @@ -1059,8 +1054,6 @@ {"name":"inst_77295BCC","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_40BD321C","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_4E6559A4","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_6EF7F598","path":"rooms/rmTest/rmTest.yy",}, - {"name":"inst_20D755C2","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_183FAA12","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_67CB4AD4","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_A0E4069","path":"rooms/rmTest/rmTest.yy",}, @@ -1080,6 +1073,15 @@ {"name":"inst_6E6AA13F","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_431637D2","path":"rooms/rmTest/rmTest.yy",}, {"name":"inst_4540865C","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_1A6C9662","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_6F66C9A6","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_7289D808","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_8CE4907","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_4AE0B63","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_7E49EC20","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_5FF3F20B","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_C98ECDA","path":"rooms/rmTest/rmTest.yy",}, + {"name":"inst_F2A1CC6","path":"rooms/rmTest/rmTest.yy",}, ], "inheritCreationOrder": false, "sequenceId": null, diff --git a/rooms/rmTestWithGroups/rmTest.yy b/rooms/rmTestLightStrip/rmTest.yy similarity index 100% rename from rooms/rmTestWithGroups/rmTest.yy rename to rooms/rmTestLightStrip/rmTest.yy diff --git a/rooms/rmTestWithGroups/rmTestWithGroups.yy b/rooms/rmTestLightStrip/rmTestLightStrip.yy similarity index 50% rename from rooms/rmTestWithGroups/rmTestWithGroups.yy rename to rooms/rmTestLightStrip/rmTestLightStrip.yy index 61e13b1..7fd39b7 100644 --- a/rooms/rmTestWithGroups/rmTestWithGroups.yy +++ b/rooms/rmTestLightStrip/rmTestLightStrip.yy @@ -1,7 +1,7 @@ { "resourceType": "GMRoom", "resourceVersion": "1.0", - "name": "rmTestWithGroups", + "name": "rmTestLightStrip", "isDnd": false, "volume": 1.0, "parentRoom": null, @@ -16,15 +16,25 @@ {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":640,"hview":480,"xport":0,"yport":0,"wport":640,"hport":480,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, ], "layers": [ - {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Player_And_Renderer","instances":[],"visible":true,"depth":-99,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, - {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Lights","instances":[],"visible":true,"depth":-199,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, - {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Occluders","instances":[],"visible":true,"depth":0,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, + {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Instances","instances":[ + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_696BC4E8","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2432.0,"y":1792.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_27264013","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder","path":"objects/oStaticOccluder/oStaticOccluder.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2432.0,"y":1824.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7CD71CA8","properties":[],"isDnd":false,"objectId":{"name":"oRenderer2","path":"objects/oRenderer2/oRenderer2.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1984.0,"y":1792.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_6AFD9790","properties":[],"isDnd":false,"objectId":{"name":"oPlayer2","path":"objects/oPlayer2/oPlayer2.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2016.0,"y":1824.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7105C049","properties":[],"isDnd":false,"objectId":{"name":"oLightStrip","path":"objects/oLightStrip/oLightStrip.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2240.0,"y":1728.0,}, + ],"visible":true,"depth":-99,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":null,"colour":4293256677,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":2147483600,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, ], "inheritLayers": false, "creationCodeFile": "", "inheritCode": false, - "instanceCreationOrder": [], + "instanceCreationOrder": [ + {"name":"inst_7CD71CA8","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",}, + {"name":"inst_6AFD9790","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",}, + {"name":"inst_696BC4E8","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",}, + {"name":"inst_27264013","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",}, + {"name":"inst_7105C049","path":"rooms/rmTestLightStrip/rmTestLightStrip.yy",}, + ], "inheritCreationOrder": false, "sequenceId": null, "roomSettings": { diff --git a/rooms/rmTestSoft/rmTestSoft.yy b/rooms/rmTestSoft/rmTestSoft.yy index fda6e16..2f730d1 100644 --- a/rooms/rmTestSoft/rmTestSoft.yy +++ b/rooms/rmTestSoft/rmTestSoft.yy @@ -16,26 +16,24 @@ {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":640,"hview":480,"xport":0,"yport":0,"wport":640,"hport":480,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, ], "layers": [ - {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Player_And_Renderer","instances":[ - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_1C9E5E16","properties":[],"isDnd":false,"objectId":{"name":"oPlayer3","path":"objects/oPlayer3/oPlayer3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":1847.0,"y":1780.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_540AE204","properties":[],"isDnd":false,"objectId":{"name":"oRenderer3","path":"objects/oRenderer3/oRenderer3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":32.0,"y":32.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_3D6BCBF5","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo3","path":"objects/oLightDiscoooo3/oLightDiscoooo3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2176.0,"y":1728.0,}, - ],"visible":true,"depth":-99,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, - {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Occluders","instances":[ - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_BBD2F4F","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder3","path":"objects/oStaticOccluder3/oStaticOccluder3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2048.0,"y":1792.0,}, - {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_1AAB7B4C","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder3","path":"objects/oDynamicOccluder3/oDynamicOccluder3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2048.0,"y":1664.0,}, - ],"visible":true,"depth":0,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, - {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":null,"colour":4293256677,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":2147483600,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, + {"resourceType":"GMRInstanceLayer","resourceVersion":"1.0","name":"Instances","instances":[ + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_53C54987","properties":[],"isDnd":false,"objectId":{"name":"oRenderer3","path":"objects/oRenderer3/oRenderer3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2016.0,"y":1824.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_217363B9","properties":[],"isDnd":false,"objectId":{"name":"oStaticOccluder3","path":"objects/oStaticOccluder3/oStaticOccluder3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2368.0,"y":1824.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7FE30DB9","properties":[],"isDnd":false,"objectId":{"name":"oDynamicOccluder3","path":"objects/oDynamicOccluder3/oDynamicOccluder3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2368.0,"y":1984.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_4A2BC9C5","properties":[],"isDnd":false,"objectId":{"name":"oPlayer3","path":"objects/oPlayer3/oPlayer3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2176.0,"y":1920.0,}, + {"resourceType":"GMRInstance","resourceVersion":"1.0","name":"inst_7CEE7F68","properties":[],"isDnd":false,"objectId":{"name":"oLightDiscoooo3","path":"objects/oLightDiscoooo3/oLightDiscoooo3.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":2400.0,"y":1920.0,}, + ],"visible":true,"depth":-99,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, + {"resourceType":"GMRBackgroundLayer","resourceVersion":"1.0","name":"Background","spriteId":null,"colour":4293256677,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":2147483600,"userdefinedDepth":true,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritVisibility":true,"inheritSubLayers":true,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"effectEnabled":true,"effectType":null,"properties":[],}, ], "inheritLayers": false, "creationCodeFile": "", "inheritCode": false, "instanceCreationOrder": [ - {"name":"inst_540AE204","path":"rooms/rmTestSoft/rmTestSoft.yy",}, - {"name":"inst_1C9E5E16","path":"rooms/rmTestSoft/rmTestSoft.yy",}, - {"name":"inst_BBD2F4F","path":"rooms/rmTestSoft/rmTestSoft.yy",}, - {"name":"inst_1AAB7B4C","path":"rooms/rmTestSoft/rmTestSoft.yy",}, - {"name":"inst_3D6BCBF5","path":"rooms/rmTestSoft/rmTestSoft.yy",}, + {"name":"inst_53C54987","path":"rooms/rmTestSoft/rmTestSoft.yy",}, + {"name":"inst_217363B9","path":"rooms/rmTestSoft/rmTestSoft.yy",}, + {"name":"inst_7FE30DB9","path":"rooms/rmTestSoft/rmTestSoft.yy",}, + {"name":"inst_4A2BC9C5","path":"rooms/rmTestSoft/rmTestSoft.yy",}, + {"name":"inst_7CEE7F68","path":"rooms/rmTestSoft/rmTestSoft.yy",}, ], "inheritCreationOrder": false, "sequenceId": null, diff --git a/scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.gml b/scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.gml new file mode 100644 index 0000000..9103bf5 --- /dev/null +++ b/scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.gml @@ -0,0 +1,11 @@ +// Feather disable all + +/// @param bulbRenderer +/// @param surface + +function BulbApplyLightingToSurface(_renderer, _surface) +{ + if (_renderer == undefined) return; + + surface_copy(_surface, 0, 0, _renderer.GetOutputSurface(_surface)); +} diff --git a/scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.yy b/scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.yy new file mode 100644 index 0000000..8543b2f --- /dev/null +++ b/scripts/BulbApplyLightingToSurface/BulbApplyLightingToSurface.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbApplyLightingToSurface", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Bulb", + "path": "folders/Bulb.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbDrawLitSurface/BulbDrawLitSurface.gml b/scripts/BulbDrawLitSurface/BulbDrawLitSurface.gml new file mode 100644 index 0000000..d8e20e0 --- /dev/null +++ b/scripts/BulbDrawLitSurface/BulbDrawLitSurface.gml @@ -0,0 +1,58 @@ +// Feather disable all + +/// @param bulbRenderer +/// @param surface +/// @param [x] +/// @param [y] +/// @param [width] +/// @param [height] +/// @param [textureFiltering] +/// @param [alphaBlend=false] + +function BulbDrawLitSurface(_renderer, _surface, _x = undefined, _y = undefined, _width = undefined, _height = undefined, _textureFiltering = undefined, _alphaBlend = false) +{ + if (surface_get_target() == _surface) + { + __BulbError("Cannot call BulbDrawLitSurface() when the destination surface and drawn surface are the same\nIf you are drawing the application surface, use a Post-Draw event or GUI draw event"); + } + + if ((_x == undefined) || (_y == undefined) || (_width == undefined) || (_height == undefined)) + { + var _positionArray = application_get_position(); + _x = _positionArray[0]; + _y = _positionArray[1]; + _width = _positionArray[2] - _x; + _height = _positionArray[3] - _y; + } + + if (_renderer == undefined) + { + if (_textureFiltering != undefined) + { + var _oldTextureFiltering = gpu_get_tex_filter(); + gpu_set_tex_filter(_textureFiltering); + } + + if (_alphaBlend != undefined) + { + var _oldAlphaBlend = gpu_get_blendenable(); + gpu_set_blendenable(_alphaBlend); + } + + draw_surface_stretched(_surface, _x, _y, _width, _height); + + if (_textureFiltering != undefined) + { + gpu_set_tex_filter(_oldTextureFiltering); + } + + if (_alphaBlend != undefined) + { + gpu_set_blendenable(_oldAlphaBlend); + } + } + else + { + _renderer.DrawLitSurface(_surface, _x, _y, _width, _height, _textureFiltering, _alphaBlend); + } +} diff --git a/scripts/BulbDrawLitSurface/BulbDrawLitSurface.yy b/scripts/BulbDrawLitSurface/BulbDrawLitSurface.yy new file mode 100644 index 0000000..1f24126 --- /dev/null +++ b/scripts/BulbDrawLitSurface/BulbDrawLitSurface.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbDrawLitSurface", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Bulb", + "path": "folders/Bulb.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbDynamicOccluder/BulbDynamicOccluder.gml b/scripts/BulbDynamicOccluder/BulbDynamicOccluder.gml index 0f1e83a..ec71d1f 100644 --- a/scripts/BulbDynamicOccluder/BulbDynamicOccluder.gml +++ b/scripts/BulbDynamicOccluder/BulbDynamicOccluder.gml @@ -27,11 +27,36 @@ function BulbDynamicOccluder(_renderer) constructor //Choose the longest axis of the sprite as the radius //We apply x/y scaling in the __IsOnScreen() function - __radius = sqrt(max(_x1*_x1 + _y1*_y1, _x2*_x2 + _y2*_y2)); + __radius = max(__radius, sqrt(max(_x1*_x1 + _y1*_y1, _x2*_x2 + _y2*_y2))); array_push(vertexArray, _x1, _y1, _x2, _y2, _y2-_y1, _x1-_x2); } + static AddCircle = function(_radius, _x = 0, _y = 0, _edges = 24) + { + if (__destroyed) return; + + __radius = max(__radius, _radius); + + var _angle = 0; + var _angleStep = 360 / _edges; + + var _x2 = _x + lengthdir_x(_radius, _angle); + var _y2 = _y + lengthdir_y(_radius, _angle); + + repeat(_edges) + { + _angle -= _angleStep; + + var _x1 = _x2; + var _y1 = _y2; + _x2 = _x + lengthdir_x(_radius, _angle); + _y2 = _y + lengthdir_y(_radius, _angle); + + array_push(vertexArray, _x1, _y1, _x2, _y2, _y2-_y1, _x1-_x2); + } + } + static ClearEdges = function(_x1, _y1, _x2, _y2) { if (__destroyed) return; diff --git a/scripts/BulbLight/BulbLight.gml b/scripts/BulbLight/BulbLight.gml index d784ed9..67b01e3 100644 --- a/scripts/BulbLight/BulbLight.gml +++ b/scripts/BulbLight/BulbLight.gml @@ -8,18 +8,19 @@ function BulbLight(_renderer, _sprite, _image, _x, _y) constructor { visible = true; - x = _x; - y = _y; - xprevious = x; - yprevious = y; + x = _x; + y = _y; - sprite = _sprite; - image = _image; - xscale = 1.0; - yscale = 1.0; - angle = 0.0; - blend = c_white; - alpha = 1.0; + normalMap = BULB_DEFAULT_USE_NORMAL_MAP; + normalMapZ = BULB_DEFAULT_NORMAL_MAP_Z; + + sprite = _sprite; + image = _image; + xscale = 1.0; + yscale = 1.0; + angle = 0.0; + blend = c_white; + intensity = 1.0; penumbraSize = 0.0; diff --git a/scripts/BulbLightOverlay/BulbLightOverlay.gml b/scripts/BulbLightOverlay/BulbLightOverlay.gml index d4f650c..d7e0e14 100644 --- a/scripts/BulbLightOverlay/BulbLightOverlay.gml +++ b/scripts/BulbLightOverlay/BulbLightOverlay.gml @@ -7,13 +7,13 @@ function BulbLightOverlay(_renderer) constructor x = 0; y = 0; - sprite = undefined; - image = 0; - xscale = 1.0; - yscale = 1.0; - angle = 0.0; - blend = c_white; - alpha = 1.0; + sprite = undefined; + image = 0; + xscale = 1.0; + yscale = 1.0; + angle = 0.0; + blend = c_white; + intensity = 1.0; __oldSprite = undefined; __radius = 0; diff --git a/scripts/BulbNormalMapClear/BulbNormalMapClear.gml b/scripts/BulbNormalMapClear/BulbNormalMapClear.gml new file mode 100644 index 0000000..941cb7d --- /dev/null +++ b/scripts/BulbNormalMapClear/BulbNormalMapClear.gml @@ -0,0 +1,26 @@ +// Feather disable all + +/// @param [baseSpecular=0] + +function BulbNormalMapClear(_baseSpecular = 0) +{ + static _u_fAlphaThreshold_Normal = shader_get_uniform(__shdBulbNormal, "u_fAlphaThreshold"); + static _u_fAlphaThreshold_Specular = shader_get_uniform(__shdBulbSpecular, "u_fAlphaThreshold"); + static _u_fAlphaThreshold_SpecularForce = shader_get_uniform(__shdBulbSpecularForce, "u_fAlphaThreshold"); + + //Re-set the alpha threshold just in case + var _shader = shader_current(); + + shader_set(__shdBulbNormal); + shader_set_uniform_f(_u_fAlphaThreshold_Normal, BULB_NORMAL_MAP_ALPHA_THRESHOLD); + + shader_set(__shdBulbSpecular); + shader_set_uniform_f(_u_fAlphaThreshold_Specular, BULB_NORMAL_MAP_ALPHA_THRESHOLD); + + shader_set(__shdBulbSpecularForce); + shader_set_uniform_f(_u_fAlphaThreshold_SpecularForce, BULB_NORMAL_MAP_ALPHA_THRESHOLD); + + shader_set(_shader); + + draw_clear_alpha(#0000FF, 1 - _baseSpecular); +} \ No newline at end of file diff --git a/scripts/BulbNormalMapClear/BulbNormalMapClear.yy b/scripts/BulbNormalMapClear/BulbNormalMapClear.yy new file mode 100644 index 0000000..011f2f3 --- /dev/null +++ b/scripts/BulbNormalMapClear/BulbNormalMapClear.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbNormalMapClear", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Normal Map", + "path": "folders/Bulb/Normal Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.gml b/scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.gml new file mode 100644 index 0000000..7193bc3 --- /dev/null +++ b/scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.gml @@ -0,0 +1,8 @@ +// Feather disable all + +/// @param [spriteIndex] + +function BulbNormalMapDrawSelf(_spriteIndex = sprite_index) +{ + BulbNormalMapDrawSpriteExt(_spriteIndex, image_index, x, y, image_xscale, image_yscale, image_angle); +} \ No newline at end of file diff --git a/scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.yy b/scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.yy new file mode 100644 index 0000000..f3c4b34 --- /dev/null +++ b/scripts/BulbNormalMapDrawSelf/BulbNormalMapDrawSelf.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbNormalMapDrawSelf", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Normal Map", + "path": "folders/Bulb/Normal Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.gml b/scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.gml new file mode 100644 index 0000000..71d44f1 --- /dev/null +++ b/scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.gml @@ -0,0 +1,11 @@ +// Feather disable all + +/// @param sprite +/// @param image +/// @param x +/// @param y + +function BulbNormalMapDrawSprite(_sprite, _image, _x, _y) +{ + draw_sprite_ext(_sprite, _image, _x, _y, 1, 1, 0, c_black, 1); +} \ No newline at end of file diff --git a/scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.yy b/scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.yy new file mode 100644 index 0000000..158c2c7 --- /dev/null +++ b/scripts/BulbNormalMapDrawSprite/BulbNormalMapDrawSprite.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbNormalMapDrawSprite", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Normal Map", + "path": "folders/Bulb/Normal Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.gml b/scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.gml new file mode 100644 index 0000000..54ec60c --- /dev/null +++ b/scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.gml @@ -0,0 +1,26 @@ +// Feather disable all + +/// @param sprite +/// @param image +/// @param x +/// @param y +/// @param xScale +/// @param yScale +/// @param angle + +function BulbNormalMapDrawSpriteExt(_sprite, _image, _x, _y, _xScale, _yScale, _angle) +{ + var _color = ((frac(_angle/360)*256*256*64) << 2) + | (((1000000*_xScale) >> 63) & 0x1) + | (((1000000*_yScale) >> 62) & 0x2); + + //The upper 22 bits in the 24-bit color are used to enough the rotation angle. + // + //We pack whether the xscale any yscale are negative into the two lowest significant bits of + //the red component of the color. We do this with a binary hack for extra speed. + // + //The multiplication by 1,000,000 is to ensure that scales less than 1 don't get rounded to + //0 when converted to an integer (which happens implicitly by the left shift operator). + + draw_sprite_ext(_sprite, _image, _x, _y, _xScale, _yScale, _angle, _color, 1); +} \ No newline at end of file diff --git a/scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.yy b/scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.yy new file mode 100644 index 0000000..d8cf008 --- /dev/null +++ b/scripts/BulbNormalMapDrawSpriteExt/BulbNormalMapDrawSpriteExt.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbNormalMapDrawSpriteExt", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Normal Map", + "path": "folders/Bulb/Normal Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.gml b/scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.gml new file mode 100644 index 0000000..0879354 --- /dev/null +++ b/scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.gml @@ -0,0 +1,7 @@ +// Feather disable all + +function BulbNormalMapShaderReset() +{ + shader_reset(); + gpu_set_colorwriteenable(true, true, true, true); +} \ No newline at end of file diff --git a/scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.yy b/scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.yy new file mode 100644 index 0000000..23e4a25 --- /dev/null +++ b/scripts/BulbNormalMapShaderReset/BulbNormalMapShaderReset.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbNormalMapShaderReset", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Normal Map", + "path": "folders/Bulb/Normal Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.gml b/scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.gml new file mode 100644 index 0000000..ec30853 --- /dev/null +++ b/scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.gml @@ -0,0 +1,9 @@ +// Feather disable all + +/// @param [forceFlat=false] + +function BulbNormalMapShaderSet(_forceFlat = false) +{ + shader_set(_forceFlat? __shdBulbNormalUp : __shdBulbNormal); + gpu_set_colorwriteenable(true, true, true, false); +} \ No newline at end of file diff --git a/scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.yy b/scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.yy new file mode 100644 index 0000000..a6d3f61 --- /dev/null +++ b/scripts/BulbNormalMapShaderSet/BulbNormalMapShaderSet.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbNormalMapShaderSet", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Normal Map", + "path": "folders/Bulb/Normal Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbRenderer/BulbRenderer.gml b/scripts/BulbRenderer/BulbRenderer.gml index eed402f..b50d561 100644 --- a/scripts/BulbRenderer/BulbRenderer.gml +++ b/scripts/BulbRenderer/BulbRenderer.gml @@ -1,1019 +1,531 @@ -/// @param ambientColour -/// @param mode -/// @param smooth +/// Constructor. Creates a Bulb renderer struct that is responsible for the final renderering of +/// lights in your game. +/// +/// @param [camera] +/// +/// Full list of variables: +/// +/// `.ambientColor` | `c_black` | Baseline ambient light color +/// `.ambientInGammaSpace` | `false` | Whether the above is in gamma space (`true`) or linear space {`false`) +/// `.smooth` | `true` | Whether to use texture filtering (bilinear interpolation) where possible +/// `.soft` | `true` | Whether to use soft shadows +/// `.selfLighting` | `false` | Whether to allow light to enter but not escape occluders. Hard shadow mode only +/// `.exposure` | `1.0` | Exposure for the entire lighting render. Should usually be left at `1.0` when not in HDR mode +/// `.ldrTonemap` | `BULB_TONEMAP_NONE` | Tonemap to use when not in HDR mode. Should usually be left at `BULB_TONEMAP_NONE` +/// `.hdr` | `false` | Whether to use HDR rendering or not. HDR surface is 16-bit +/// `.hdrTonemap` | `BULB_TONEMAP_HBD` | Tonemap to use when in HDR mode +/// `.hdrBloomIntensity` | `0` | Intensity of the bloom effect +/// `.hdrBloomIterations` | `3` | Number of Kawase blur iterations to apply to the bloom +/// `.hdrBloomThresholdMin` | `0.6` | Lower threshold for bloom cut-off +/// `.hdrBloomThresholdMax` | `0.8` | Upper threshold for bloom cut-off +/// `.normalMap` | Config macro | Whether normal mapping should be used. Defaults to `BULB_DEFAULT_USE_NORMAL_MAP` +/// +/// Full list of methods: +/// +/// `.Free()` +/// `.SetCamera(camera)` +/// `.GetCamera()` +/// `.SetSurfaceDimensions(width, height)` +/// `.GetSurfaceDimensions()` +/// `.Update()` +/// `.GetOutputSurface(surface)` +/// `.DrawLitSurface(surface, x, y, width, height, [textureFiltering], [alphaBlend])` +/// `.GetTonemap()` +/// `.GetLightSurface()` +/// `.GetLightValue(x, y)` +/// `.GetNormalMapSurface() +/// `.DrawNormalMapDebug(x, y, width, height)` +/// `.RefreshStaticOccluders()` -enum BULB_MODE +function BulbRenderer(_camera) constructor { - HARD_BM_ADD, - HARD_BM_ADD_SELFLIGHTING, - HARD_BM_MAX, - HARD_BM_MAX_SELFLIGHTING, - SOFT_BM_ADD, - __SIZE -} - -function BulbRenderer(_ambientColour, _mode, _smooth) constructor -{ - //Assign the ambient colour used for the darkest areas of the screen. This can be changed on the fly - ambientColor = _ambientColour; - - //The smoothing mode controls texture filtering both when accumulating lights and when drawing the resulting __surface - smooth = _smooth; - - mode = _mode; - - surfaceWidth = -1; - surfaceHeight = -1; - - //Initialise variables used and updated in .__UpdateVertexBuffers() - __staticVBuffer = undefined; //Vertex buffer describing the geometry of static occluder objects - __dynamicVBuffer = undefined; //As above but for dynamic shadow occluders. This is updated every step - __surface = undefined; //Screen-space __surface for final accumulation of lights - - __staticOccludersArray = []; - __dynamicOccludersArray = []; - __lightsArray = []; - __sunlightArray = []; - __ambienceSpriteArray = []; - __shadowOverlayArray = []; - __lightOverlayArray = []; - - __freed = false; - __oldMode = undefined; - - __clipEnabled = false; - __clipSurface = undefined; - __clipIsShadow = true; - __clipAlpha = 1.0; - __clipInvert = false; - __clipValueToAlpha = false; + static _system = __BulbSystem(); + static _vformat3DNormal = (function() + { + vertex_format_begin(); + vertex_format_add_position_3d(); + vertex_format_add_normal(); + return vertex_format_end(); + })(); + + static _vformat3DNormalTex = (function() + { + vertex_format_begin(); + vertex_format_add_position_3d(); + vertex_format_add_normal(); + vertex_format_add_texcoord(); + return vertex_format_end(); + })(); - #region Public Methods - static SetSurfaceDimensionsFromCamera = function(_camera) + SetCamera = function(_camera) { - var _projMatrix = camera_get_proj_mat(_camera); - var _width = round(abs(2/_projMatrix[0])); - var _height = round(abs(2/_projMatrix[5])); + if (__cameraImplicit) + { + camera_destroy(__camera); + } - return SetSurfaceDimensions(_width, _height); - } - - static SetSurfaceDimensions = function(_width, _height) - { - surfaceWidth = _width; - surfaceHeight = _height; + if (_camera != undefined) + { + __camera = _camera; + __cameraImplicit = false; + } + else + { + __camera = camera_create_view(0, 0, room_width, room_height, 0, noone, 0, 0, 0, 0); + __cameraImplicit = true; + } - GetSurface(); - GetClippingSurface(); - } - - static SetClippingSurface = function(_clipIsShadow, _clipAlpha, _clipInvert = false, _hsvValueToAlpha = false) - { - __clipEnabled = true; - __clipIsShadow = _clipIsShadow; - __clipAlpha = _clipAlpha; - __clipInvert = _clipInvert; - __clipValueToAlpha = _hsvValueToAlpha; + //Set the lighting surface dimensions from the camera + var _projMatrix = camera_get_proj_mat(__camera); + var _width = round(abs(2/_projMatrix[0])); + var _height = round(abs(2/_projMatrix[5])); + SetSurfaceDimensions(_width, _height); } - static RemoveClippingSurface = function() + GetCamera = function() { - __clipEnabled = false; - __FreeClipSurface(); + return __camera; } - static CopyClippingSurface = function(_surface) + SetSurfaceDimensions = function(_width, _height) { - gpu_set_blendmode_ext(bm_one, bm_zero); - surface_copy(GetClippingSurface(), 0, 0, _surface); - gpu_set_blendmode(bm_normal); - } - - static SetAmbientColor = function(_color) - { - ambientColor = _color; + __surfaceWidth = _width; + __surfaceHeight = _height; + + GetLightSurface(); } - static GetAmbientColor = function() + GetSurfaceDimensions = function() { - return ambientColor; + static _result = {}; + + _result.width = __surfaceWidth; + _result.height = __surfaceHeight; + + return _result; } - static UpdateFromCamera = function(_camera) + Update = function() { //Deploy PROPER MATHS in case the dev is using matrices - var _viewMatrix = camera_get_view_mat(_camera); - var _projMatrix = camera_get_proj_mat(_camera); + var _viewMatrix = camera_get_view_mat(__camera); + var _projMatrix = camera_get_proj_mat(__camera); - var _cameraX = -_viewMatrix[12]; - var _cameraY = -_viewMatrix[13]; - var _cameraViewWidth = round(abs(2/_projMatrix[0])); - var _cameraViewHeight = round(abs(2/_projMatrix[5])); - var _cameraLeft = _cameraX - _cameraViewWidth/2; - var _cameraTop = _cameraY - _cameraViewHeight/2; + var _cameraCos = _viewMatrix[ 0]; + var _cameraSin = _viewMatrix[ 1]; + var _matrixX = -_viewMatrix[12]; + var _matrixY = -_viewMatrix[13]; - return Update(_cameraLeft, _cameraTop, _cameraViewWidth, _cameraViewHeight); - } - - static Update = function(_cameraL, _cameraT, _cameraW, _cameraH) - { - if (__freed) return undefined; + var _cameraCX = _matrixX*_cameraCos + _matrixY*_cameraSin; + var _cameraCY = -_matrixX*_cameraSin + _matrixY*_cameraCos; + var _cameraW = round(abs(2/_projMatrix[0])); + var _cameraH = round(abs(2/_projMatrix[5])); - static _worldMatrix = [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]; + var _rotatedW = _cameraW*abs(_cameraCos) + _cameraH*abs(_cameraSin); + var _rotatedH = _cameraW*abs(_cameraSin) + _cameraH*abs(_cameraCos); - if (surfaceWidth <= 0) surfaceWidth = _cameraW; - if (surfaceHeight <= 0) surfaceHeight = _cameraH; + var _boundaryL = _cameraCX - _rotatedW/2; + var _boundaryT = _cameraCY - _rotatedH/2; + var _boundaryR = _cameraCX + _rotatedW/2; + var _boundaryB = _cameraCY + _rotatedH/2; - if (mode != __oldMode) + var _boundaryExpandedL = _boundaryL - BULB_DYNAMIC_OCCLUDER_RANGE; + var _boundaryExpandedT = _boundaryT - BULB_DYNAMIC_OCCLUDER_RANGE; + var _boundaryExpandedR = _boundaryR + BULB_DYNAMIC_OCCLUDER_RANGE; + var _boundaryExpandedB = _boundaryB + BULB_DYNAMIC_OCCLUDER_RANGE; + + //Force a regeneration of vertex buffers if we're swapped between hard/soft lights + if (soft != __oldSoft) { - __oldMode = mode; + __oldSoft = soft; __FreeVertexBuffers(); } - var _cameraR = _cameraL + _cameraW; - var _cameraB = _cameraT + _cameraH; - var _cameraCX = _cameraL + 0.5*_cameraW; - var _cameraCY = _cameraT + 0.5*_cameraH; - - //Construct our wipe/static/dynamic vertex buffers - __UpdateVertexBuffers(_cameraL, _cameraT, _cameraR, _cameraB, _cameraW, _cameraH); - - //Create accumulating lighting __surface - surface_set_target(GetSurface()); - - gpu_set_cullmode(cull_noculling); - - //Really we should use the view matrix for this, but GameMaker's sprite culling is fucked - //If we use a proper view matrix then lighting sprites are culling, leading to no lighting being drawn - _worldMatrix[@ 12] = -_cameraL; - _worldMatrix[@ 13] = -_cameraT; - matrix_set(matrix_world, _worldMatrix); - - //Record the current texture filter state, then set our new filter state - var _old_tex_filter = gpu_get_tex_filter(); - gpu_set_tex_filter(smooth); - - //Clear the __surface with the ambient colour - draw_clear(ambientColor); - - //If we're not forcing deferred rendering everywhere, update those lights - __AccumulateLights(_cameraL, _cameraT, _cameraR, _cameraB, _cameraCX, _cameraCY, _cameraW, _cameraH); - - if (__clipEnabled) __ApplyClippingSurface(); - - //Restore the old filter state - gpu_set_tex_filter(_old_tex_filter); - - surface_reset_target(); - matrix_set(matrix_world, matrix_build_identity()); - } - - /// @param camera - /// @param [alpha] - static DrawOnCamera = function() - { - var _camera = argument[0]; - var _alpha = ((argument_count > 1) && (argument[1] != undefined))? argument[1] : undefined; - - var _viewMatrix = camera_get_view_mat(_camera); - var _projMatrix = camera_get_proj_mat(_camera); - - //Deploy PROPER MATHS in case the dev is using matrices - var _cameraX = -_viewMatrix[12]; - var _cameraY = -_viewMatrix[13]; - var _cameraViewWidth = round(abs(2/_projMatrix[0])); - var _cameraViewHeight = round(abs(2/_projMatrix[5])); - var _cameraLeft = _cameraX - _cameraViewWidth/2; - var _cameraTop = _cameraY - _cameraViewHeight/2; - - return Draw(_cameraLeft, _cameraTop, _cameraViewWidth, _cameraViewHeight, _alpha); - } - - /// @param x - /// @param y - /// @param [width] - /// @param [height] - /// @param [alpha] - static Draw = function() - { - if (__freed) return undefined; - - var _x = argument[0]; - var _y = argument[1]; - var _width = ((argument_count > 2) && (argument[2] != undefined))? argument[2] : surfaceWidth; - var _height = ((argument_count > 3) && (argument[3] != undefined))? argument[3] : surfaceHeight; - var _alpha = ((argument_count > 4) && (argument[4] != undefined))? argument[4] : 1.0; + //Determine whether we actually want HDR + var _hdr = (hdr && _system.__hdrAvailable); - if ((__surface != undefined) && surface_exists(__surface)) + //Force regeneration/freeing of surfaces if the HDR state has changed + if (_hdr != __oldHDR) { - //Record the current texture filter state, then set our new filter state - var _old_tex_filter = gpu_get_tex_filter(); - gpu_set_tex_filter(smooth); - - gpu_set_colorwriteenable(true, true, true, false); + __oldHDR = _hdr; - if (_alpha == 1.0) + if (__lightSurface != undefined) { - //Don't use the shader if we don't have to! - gpu_set_blendmode_ext(bm_dest_color, bm_zero); - draw_surface_stretched(__surface, _x, _y, _width, _height); + surface_free(__lightSurface); + __lightSurface = undefined; } - else + + if (not _hdr) { - gpu_set_blendmode_ext(bm_dest_color, bm_inv_src_alpha); - shader_set(__shdBulbFinalRender); - draw_surface_stretched_ext(__surface, _x, _y, _width, _height, c_white, _alpha); - shader_reset(); + __FreeOutputSurface(); } - - gpu_set_blendmode(bm_normal); - gpu_set_colorwriteenable(true, true, true, true); - - //Restore the old filter state - gpu_set_tex_filter(_old_tex_filter); } - } - - static GetSurface = function() - { - if (__freed) return undefined; - if ((surfaceWidth <= 0) || (surfaceHeight <= 0)) return undefined; - if ((__surface != undefined) && ((surface_get_width(__surface) != surfaceWidth) || (surface_get_height(__surface) != surfaceHeight))) + //Manage bloom surfaces if the number of iterations has changed + if ((not _hdr) || (hdrBloomIterations != __oldHDRBloomIterations)) { - surface_free(__surface); - __surface = undefined; + __FreeBloomSurfaces(); } - if ((__surface == undefined) || !surface_exists(__surface)) + //Free up memory if the normal map state has changed + if ((not normalMap) && __oldNormalMap) { - __surface = surface_create(surfaceWidth, surfaceHeight); - - surface_set_target(__surface); - draw_clear_alpha(c_black, 1.0); - surface_reset_target(); + __FreeNormalMapSurface(); } - return __surface; - } - - static GetClippingSurface = function() - { - if (__freed || !__clipEnabled) return undefined; - if ((surfaceWidth <= 0) || (surfaceHeight <= 0)) return undefined; + //Construct our wipe/static/dynamic vertex buffers + __UpdateVertexBuffers(_boundaryExpandedL, _boundaryExpandedT, _boundaryExpandedR, _boundaryExpandedB); - if ((__clipSurface != undefined) && ((surface_get_width(__clipSurface) != surfaceWidth) || (surface_get_height(__clipSurface) != surfaceHeight))) - { - surface_free(__clipSurface); - __clipSurface = undefined; - } + //Create accumulating renderer surface + surface_set_target(GetLightSurface()); - if ((__clipSurface == undefined) || !surface_exists(__clipSurface)) - { - __clipSurface = surface_create(surfaceWidth, surfaceHeight); - - surface_set_target(__clipSurface); - - if (__clipInvert) - { - draw_clear_alpha(c_black, 0.0); - } - else - { - draw_clear_alpha(c_white, 1.0); - } - - surface_reset_target(); - } + //Set the view/projection matrices + camera_apply(__camera); - return __clipSurface; - } - - static RefreshStaticOccluders = function() - { - if (__freed) return undefined; + //Set up some GPU state + var _oldNoCulling = gpu_get_cullmode(); + var _oldTexFilter = gpu_get_tex_filter(); + gpu_set_cullmode(cull_noculling); + gpu_set_tex_filter(smooth); + + //Clear the light surface with the ambient colour + draw_clear(__GetAmbientColor()); - if (__staticVBuffer != undefined) + //Accumulate lights and shadows onto the lighting surface + __AccumulateAmbienceSprite(_boundaryL, _boundaryT, _boundaryR, _boundaryB); + + if (soft) { - vertex_delete_buffer(__staticVBuffer); - __staticVBuffer = undefined; + __AccumulateSoftLights(_boundaryL, _boundaryT, _boundaryR, _boundaryB, _cameraCX, _cameraCY, _cameraW, _cameraH, _cameraCos, _cameraSin, selfLighting? -1 : 1); + } + else + { + __AccumulateHardLights(_boundaryL, _boundaryT, _boundaryR, _boundaryB, _cameraCX, _cameraCY, _cameraW, _cameraH, _cameraCos, _cameraSin, selfLighting? -1 : 1); } - } - - static Free = function() - { - __FreeVertexBuffers(); - __FreeSurface(); - __FreeClipSurface(); - - __freed = true; - } - - static GetSurfacePixel = function(_worldX, _worldY, _cameraL, _cameraT, _cameraW, _cameraH) - { - var _surface = GetSurface(); - var _x = (_worldX - _cameraL) * (surface_get_width( _surface) / _cameraW); - var _y = (_worldY - _cameraT) * (surface_get_height(_surface) / _cameraH); - return surface_getpixel_ext(_surface, _x, _y); - } - - static GetSurfacePixelFromCamera = function(_worldX, _worldY, _camera) - { - //Deploy PROPER MATHS in case the dev is using matrices - var _viewMatrix = camera_get_view_mat(_camera); - var _projMatrix = camera_get_proj_mat(_camera); + __AccumulateShadowOverlay(_boundaryL, _boundaryT, _boundaryR, _boundaryB); + __AccumulateLightOverlay(_boundaryL, _boundaryT, _boundaryR, _boundaryB); - var _cameraX = -_viewMatrix[12]; - var _cameraY = -_viewMatrix[13]; - var _cameraViewWidth = round(abs(2/_projMatrix[0])); - var _cameraViewHeight = round(abs(2/_projMatrix[5])); - var _cameraLeft = _cameraX - _cameraViewWidth/2; - var _cameraTop = _cameraY - _cameraViewHeight/2; + //Restore default behaviour + gpu_set_colorwriteenable(true, true, true, true); + gpu_set_blendmode(bm_normal); + gpu_set_cullmode(_oldNoCulling); + gpu_set_tex_filter(_oldTexFilter); - return GetSurfacePixel(_worldX, _worldY, _cameraLeft, _cameraTop, _cameraViewWidth, _cameraViewHeight); + surface_reset_target(); } - #endregion - - static __FreeVertexBuffers = function() + __GetTonemapShader = function() { - if (__staticVBuffer != undefined) + var _hdrTonemap = GetTonemap(); + if (_hdrTonemap == BULB_TONEMAP_NONE) { - vertex_delete_buffer(__staticVBuffer); - __staticVBuffer = undefined; + return __shdBulbTonemapNone; } - - if (__dynamicVBuffer != undefined) + else if (_hdrTonemap == BULB_TONEMAP_CLAMP) { - vertex_delete_buffer(__dynamicVBuffer); - __dynamicVBuffer = undefined; + return __shdBulbTonemapClamp; } - } - - static __FreeSurface = function() - { - if ((__surface != undefined) && surface_exists(__surface)) + else if (_hdrTonemap == BULB_TONEMAP_REINHARD) { - surface_free(__surface); - __surface = undefined; + return __shdBulbTonemapReinhard; } - } - - static __FreeClipSurface = function() - { - if ((__clipSurface != undefined) && surface_exists(__clipSurface)) + else if (_hdrTonemap == BULB_TONEMAP_REINHARD_EXTENDED) { - surface_free(__clipSurface); - __clipSurface = undefined; + return __shdBulbTonemapReinhardExtended; } - } - - #region Update vertex buffers - - static __UpdateVertexBuffers = function(_cameraL, _cameraT, _cameraR, _cameraB, _cameraW, _cameraH) - { - if (__freed) return undefined; - - ///////////Discover camera variables - var _cameraExpL = _cameraL - BULB_DYNAMIC_OCCLUDER_RANGE; - var _cameraExpT = _cameraT - BULB_DYNAMIC_OCCLUDER_RANGE; - var _cameraExpR = _cameraR + BULB_DYNAMIC_OCCLUDER_RANGE; - var _cameraExpB = _cameraB + BULB_DYNAMIC_OCCLUDER_RANGE; - - //One-time construction of the static occluder geometry - if (__staticVBuffer == undefined) + else if (_hdrTonemap == BULB_TONEMAP_ACES) { - //Create a new vertex buffer - __staticVBuffer = vertex_create_buffer(); - var _staticVBuffer = __staticVBuffer; - - //Add static shadow caster vertices to the relevant vertex buffer - if (mode == BULB_MODE.SOFT_BM_ADD) - { - vertex_begin(__staticVBuffer, global.__bulbFormat3DNormalTex); - - var _array = __staticOccludersArray; - var _i = 0; - repeat(array_length(_array)) - { - var _weak = _array[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(_array, _i, 1); - } - else - { - with(_weak.ref) __BulbAddOcclusionSoft(_staticVBuffer); - ++_i; - } - } - } - else - { - vertex_begin(__staticVBuffer, global.__bulbFormat3DNormal); - - var _array = __staticOccludersArray; - var _i = 0; - repeat(array_length(_array)) - { - var _weak = _array[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(_array, _i, 1); - } - else - { - with(_weak.ref) __BulbAddOcclusionHard(_staticVBuffer); - ++_i; - } - } - } - - vertex_end(__staticVBuffer); - - //Freeze this buffer for speed boosts later on (though only if we have vertices in this buffer) - if (vertex_get_number(__staticVBuffer) > 0) vertex_freeze(__staticVBuffer); + return __shdBulbTonemapACES; } - - //Refresh the dynamic occluder geometry - if (__dynamicVBuffer == undefined) __dynamicVBuffer = vertex_create_buffer(); - var _dynamicVBuffer = __dynamicVBuffer; - - //Add dynamic occluder vertices to the relevant vertex buffer - if (mode == BULB_MODE.SOFT_BM_ADD) + else if (_hdrTonemap == BULB_TONEMAP_UNCHARTED2) { - vertex_begin(_dynamicVBuffer, global.__bulbFormat3DNormalTex); - - var _array = __dynamicOccludersArray; - var _i = 0; - repeat(array_length(_array)) - { - var _weak = _array[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(_array, _i, 1); - } - else - { - with(_weak.ref) - { - if (__IsOnScreen(_cameraExpL, _cameraExpT, _cameraExpR, _cameraExpB)) __BulbAddOcclusionSoft(_dynamicVBuffer); - } - - ++_i; - } - } + return __shdBulbTonemapUncharted2; } - else + else if (_hdrTonemap == BULB_TONEMAP_UNREAL3) { - vertex_begin(_dynamicVBuffer, global.__bulbFormat3DNormal); - - var _array = __dynamicOccludersArray; - var _i = 0; - repeat(array_length(_array)) - { - var _weak = _array[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(_array, _i, 1); - } - else - { - with(_weak.ref) - { - if (__IsOnScreen(_cameraExpL, _cameraExpT, _cameraExpR, _cameraExpB)) __BulbAddOcclusionHard(_dynamicVBuffer); - } - - ++_i; - } - } + return __shdBulbTonemapUnreal3; } - - vertex_end(_dynamicVBuffer); - } - - #endregion - - #region Accumulate lights - - static __AccumulateLights = function(_cameraL, _cameraT, _cameraR, _cameraB, _cameraCX, _cameraCY, _cameraW, _cameraH) - { - if (__freed) return undefined; - - __AccumulateAmbienceSprite(_cameraL, _cameraT, _cameraR, _cameraB); - - var _normalCoeff = ((mode == BULB_MODE.HARD_BM_ADD_SELFLIGHTING) || (mode == BULB_MODE.HARD_BM_MAX_SELFLIGHTING))? -1 : 1; - - //Iterate over all non-deferred lights... - if (mode == BULB_MODE.SOFT_BM_ADD) + else if (_hdrTonemap == BULB_TONEMAP_HBD) { - __AccumulateSoftLights(_cameraL, _cameraT, _cameraR, _cameraB, _cameraCX, _cameraCY, _cameraW, _cameraH, _normalCoeff); + return __shdBulbTonemapHBD; } else { - __AccumulateHardLights(_cameraL, _cameraT, _cameraR, _cameraB, _cameraCX, _cameraCY, _cameraW, _cameraH, _normalCoeff); + return __shdBulbTonemapBadGamma; } + } + + GetOutputSurface = function(_surface) + { + var _surfaceWidth = surface_get_width( _surface); + var _surfaceHeight = surface_get_height(_surface); + __GetOutputSurface(_surfaceWidth, _surfaceHeight); - __AccumulateShadowOverlay(_cameraL, _cameraT, _cameraR, _cameraB); - __AccumulateLightOverlay(_cameraL, _cameraT, _cameraR, _cameraB); + surface_set_target(__outputSurface); + DrawLitSurface(_surface, 0, 0, _surfaceWidth, _surfaceHeight, false, false); + surface_reset_target(); - //Restore default behaviour - gpu_set_colorwriteenable(true, true, true, true); - gpu_set_blendmode(bm_normal); + return __outputSurface; } - static __AccumulateAmbienceSprite = function(_cameraL, _cameraT, _cameraR, _cameraB) + DrawLitSurface = function(_surface, _x, _y, _width, _height, _textureFiltering = undefined, _alphaBlend = undefined) { - //Now draw shadow overlay sprites, if we have any - var _size = array_length(__ambienceSpriteArray); - if (_size > 0) + if (surface_get_target() == _surface) { - gpu_set_colorwriteenable(true, true, true, false); - - var _i = 0; - repeat(_size) - { - var _weak = __ambienceSpriteArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(__ambienceSpriteArray, _i, 1); - } - else - { - with(_weak.ref) - { - if (visible) - { - __CheckSpriteDimensions(); - - //If this light is active, do some drawing - if (__IsOnScreen(_cameraL, _cameraT, _cameraR, _cameraB)) - { - draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, alpha); - } - } - } - - ++_i; - } - } - - gpu_set_colorwriteenable(true, true, true, true); + __BulbError("Cannot call .DrawLitSurface() when the destination surface and drawn surface are the same\nIf you are drawing the application surface, use a Post-Draw event or GUI draw event"); } - } - - static __AccumulateShadowOverlay = function(_cameraL, _cameraT, _cameraR, _cameraB) - { - //Now draw shadow overlay sprites, if we have any - var _size = array_length(__shadowOverlayArray); - if (_size > 0) + + var _oldTextureFiltering = gpu_get_tex_filter(); + var _oldAlphaBlend = gpu_get_blendenable(); + + if (_textureFiltering != undefined) gpu_set_tex_filter(_textureFiltering); + if (_alphaBlend != undefined) gpu_set_blendenable(_alphaBlend); + + if ((__lightSurface != undefined) && surface_exists(__lightSurface)) { - if (BULB_SHADOW_OVERLAY_HSV_VALUE_TO_ALPHA) + if (hdr && _system.__hdrAvailable + && (hdrBloomIntensity > 0) && (hdrBloomIterations >= 1) + && (__lightSurface != undefined) && surface_exists(__lightSurface)) { - shader_set(__shdBulbHSVValueToAlpha); - } - else - { - //Leverage the fog system to force the colour of the sprites we draw (alpha channel passes through) - shader_reset(); - gpu_set_fog(true, ambientColor, 0, 0); + __KawaseBloom(__lightSurface, 1/max(0.0001, exposure)); } - //Don't touch the alpha channel - //TODO - We may need to adjust the alpha channel for use with sharing occlusion values - gpu_set_colorwriteenable(true, true, true, false); + var _shader = __GetTonemapShader(); + var _exposureUniform = shader_get_uniform(_shader, "u_fExposure"); + var _sampler = shader_get_sampler_index(_shader, "u_sLightMap"); - var _ambientColor = ambientColor; - var _i = 0; - repeat(_size) - { - var _weak = __shadowOverlayArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(__shadowOverlayArray, _i, 1); - } - else - { - with(_weak.ref) - { - if (visible) - { - __CheckSpriteDimensions(); - - //If this light is active, do some drawing - if (__IsOnScreen(_cameraL, _cameraT, _cameraR, _cameraB)) - { - //We send the ambient colour over as well even though we have fogging on - //This allow us to colour the sprite when using the __shdBulbHSVValueToAlpha shader - draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, _ambientColor, alpha); - } - } - } - - ++_i; - } - } - - if (BULB_SHADOW_OVERLAY_HSV_VALUE_TO_ALPHA) - { - //Don't use the value->alpha shader carry on - shader_reset(); - } - else - { - //We're already using the default GM shader, though let's reset the fog value - gpu_set_fog(false, c_fuchsia, 0, 0); - } - } - else - { + shader_set(_shader); + shader_set_uniform_f(_exposureUniform, exposure); + texture_set_stage(_sampler, surface_get_texture(__lightSurface)); + gpu_set_tex_filter_ext(_sampler, smooth); + draw_surface_stretched(_surface, _x, _y, _width, _height); shader_reset(); } - } - - static __AccumulateLightOverlay = function(_cameraL, _cameraT, _cameraR, _cameraB) - { - //Finally, draw light overlay sprites too - //We use the overarching blend mode for the renderer - if ((mode == BULB_MODE.HARD_BM_MAX) || (mode == BULB_MODE.HARD_BM_MAX_SELFLIGHTING)) - { - gpu_set_blendmode(bm_max); - } else { - gpu_set_blendmode(bm_add); + draw_surface_stretched(_surface, _x, _y, _width, _height); } - //Don't touch the alpha channel though - gpu_set_colorwriteenable(true, true, true, false); - - var _i = 0; - repeat(array_length(__lightOverlayArray)) - { - var _weak = __lightOverlayArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(__lightOverlayArray, _i, 1); - } - else - { - with(_weak.ref) - { - if (visible) - { - __CheckSpriteDimensions(); - - //If this light is active, do some drawing - if (__IsOnScreen(_cameraL, _cameraT, _cameraR, _cameraB)) - { - draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, alpha); - } - } - } - - ++_i; - } - } + gpu_set_tex_filter(_oldTextureFiltering); + gpu_set_blendenable(_oldAlphaBlend); } - #endregion - - #region Accumulate soft lights - - static __AccumulateSoftLights = function(_cameraL, _cameraT, _cameraR, _cameraB, _cameraCX, _cameraCY, _cameraW, _cameraH, _normalCoeff) + __KawaseBloom = function(_surface, _thresholdCoeff) { - if (__freed) return undefined; + static _u_fIntensity = shader_get_uniform(__shdBulbIntensity, "u_fIntensity"); + static _u_vThreshold = shader_get_uniform(__shdBulbKawaseDownWithThreshold, "u_vThreshold"); - static _u_vLight = shader_get_uniform(__shdBulbSoftShadows, "u_vLight" ); - static _sunlight_u_vLightVector = shader_get_uniform(__shdBulbSoftShadowsSunlight, "u_vLightVector"); + var _surfaceWidth = surface_get_width( _surface); + var _surfaceHeight = surface_get_height(_surface); - var _staticVBuffer = __staticVBuffer; - var _dynamicVBuffer = __dynamicVBuffer; + var _bloomSurfaceArray = __bloomSurfaceArray; - var _i = 0; - repeat(array_length(__lightsArray)) + //Create new bloom surfaces on demand + if (array_length(_bloomSurfaceArray) < hdrBloomIterations-1) { - var _weak = __lightsArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) - { - array_delete(__lightsArray, _i, 1); - } - else + __FreeBloomSurfaces(); + + var _bloomWidth = _surfaceWidth; + var _bloomHeight = _surfaceHeight; + + //Work around compile error in LTS + var _surface_create = surface_create; + + var _i = 0; + repeat(hdrBloomIterations) { - with(_weak.ref) - { - if (visible) - { - __CheckSpriteDimensions(); - - //If this light is active, do some drawing - if (__IsOnScreen(_cameraL, _cameraT, _cameraR, _cameraB)) - { - if (castShadows) - { - //Only write into the alpha channel - gpu_set_colorwriteenable(false, false, false, true); - - //Clear the alpha channel for the light's visual area - gpu_set_blendmode_ext(bm_one, bm_zero); - draw_sprite_ext(sprite, image, - x, y, - xscale, yscale, angle, - c_black, alpha); - - //Cut out shadows in the alpha channel - gpu_set_blendmode(bm_subtract); - - shader_set(__shdBulbSoftShadows); - shader_set_uniform_f(_u_vLight, x, y, penumbraSize); - vertex_submit(_staticVBuffer, pr_trianglelist, -1); - vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); - - //Set the light sprite to borrowing the alpha channel already on the surface - gpu_set_colorwriteenable(true, true, true, false); - gpu_set_blendmode_ext(bm_dest_alpha, bm_one); - - //Draw light sprite - shader_reset(); - draw_sprite_ext(sprite, image, - x, y, - xscale, yscale, angle, - blend, 1); - } - else - { - //No shadows - draw the light sprite normally - gpu_set_blendmode(bm_add); - draw_sprite_ext(sprite, image, - x, y, - xscale, yscale, angle, - blend, alpha); - } - } - } - } + _bloomWidth = _bloomWidth div 2; + _bloomHeight = _bloomHeight div 2; + _bloomSurfaceArray[_i] = _surface_create(_bloomWidth, _bloomHeight, surface_rgba16float); ++_i; } } - var _i = 0; - repeat(array_length(__sunlightArray)) + //Perform Kawase blur + var _oldTextureFiltering = gpu_get_tex_filter(); + var _oldAlphaBlend = gpu_get_blendenable(); + + gpu_set_tex_filter(true); + gpu_set_blendenable(false); + + surface_set_target(_bloomSurfaceArray[0]); + shader_set(__shdBulbKawaseDownWithThreshold); + shader_set_uniform_f(_u_vThreshold, hdrBloomThresholdMin*_thresholdCoeff, hdrBloomThresholdMax*_thresholdCoeff); + shader_set_uniform_f(shader_get_uniform(__shdBulbKawaseDownWithThreshold, "u_vTexel"), texture_get_texel_width(surface_get_texture(_surface)), texture_get_texel_height(surface_get_texture(_surface))); + draw_surface_stretched(_surface, 0, 0, surface_get_width(_bloomSurfaceArray[0]), surface_get_height(_bloomSurfaceArray[0])); + shader_reset(); + surface_reset_target(); + + if (hdrBloomIterations >= 2) { - var _weak = __sunlightArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + var _i = 1; + repeat(hdrBloomIterations-1) { - array_delete(__sunlightArray, _i, 1); + surface_set_target(_bloomSurfaceArray[_i]); + shader_set(__shdBulbKawaseDown); + shader_set_uniform_f(shader_get_uniform(__shdBulbKawaseDown, "u_vTexel"), texture_get_texel_width(surface_get_texture(_bloomSurfaceArray[_i-1])), texture_get_texel_height(surface_get_texture(_bloomSurfaceArray[_i-1]))); + draw_surface_stretched(_bloomSurfaceArray[_i-1], 0, 0, surface_get_width(_bloomSurfaceArray[_i]), surface_get_height(_bloomSurfaceArray[_i])); + surface_reset_target(); + + ++_i; } - else + + var _i = hdrBloomIterations-1; + repeat(hdrBloomIterations-1) { - with(_weak.ref) - { - if (visible) - { - //Only write into the alpha channel - gpu_set_colorwriteenable(false, false, false, true); - - //Clear the alpha channel for the light's visual area - gpu_set_blendmode_ext(bm_one, bm_zero); - draw_sprite_ext(__sprBulbPixel, 0, _cameraL, _cameraT, _cameraW+1, _cameraH+1, 0, c_black, alpha); - - //Cut out shadows in the alpha channel - gpu_set_blendmode(bm_subtract); - - shader_set(__shdBulbSoftShadowsSunlight); - shader_set_uniform_f(_sunlight_u_vLightVector, dcos(angle), -dsin(angle), penumbraSize); - vertex_submit(_staticVBuffer, pr_trianglelist, -1); - vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); - - //Set the light sprite to borrowing the alpha channel already on the surface - gpu_set_colorwriteenable(true, true, true, false); - gpu_set_blendmode_ext(bm_dest_alpha, bm_one); - - //Draw light sprite - shader_reset(); - draw_sprite_ext(__sprBulbPixel, 0, _cameraL, _cameraT, _cameraW+1, _cameraH+1, 0, blend, 1); - } - } + surface_set_target(_bloomSurfaceArray[_i-1]); + shader_set(__shdBulbKawaseUp); + shader_set_uniform_f(shader_get_uniform(__shdBulbKawaseUp, "u_vTexel"), texture_get_texel_width(surface_get_texture(_bloomSurfaceArray[_i])), texture_get_texel_height(surface_get_texture(_bloomSurfaceArray[_i]))); + draw_surface_stretched(_bloomSurfaceArray[_i], 0, 0, surface_get_width(_bloomSurfaceArray[_i-1]), surface_get_height(_bloomSurfaceArray[_i-1])); + surface_reset_target(); - ++_i; + --_i; } } + + gpu_set_blendenable(true); - gpu_set_blendmode(bm_normal); + surface_set_target(_surface); + + gpu_set_blendmode_ext(bm_one, bm_one); + shader_set(__shdBulbIntensity); + shader_set_uniform_f(_u_fIntensity, hdrBloomIntensity); + draw_surface_stretched_ext(_bloomSurfaceArray[0], 0, 0, _surfaceWidth, _surfaceHeight, c_white, 1); + + gpu_set_blendmode(bm_normal); + shader_reset(); + + surface_reset_target(); + + gpu_set_tex_filter(_oldTextureFiltering); + gpu_set_blendenable(_oldAlphaBlend); } - #endregion + Free = function() + { + __FreeVertexBuffers(); + __FreeLightSurface(); + __FreeOutputSurface(); + __FreeBloomSurfaces(); + __FreeNormalMapSurface(); + + var _nullFunc = function() {} + + //BulbRenderer() + SetCamera = _nullFunc; + GetCamera = _nullFunc; + SetSurfaceDimensions = _nullFunc; + GetSurfaceDimensions = _nullFunc; + Update = _nullFunc; + GetOutputSurface = _nullFunc; + DrawLitSurface = _nullFunc; + GetTonemap = _nullFunc; + RefreshStaticOccluders = _nullFunc; + __KawaseBloom = _nullFunc; + + //__BulbRendererDefineHDR() + __GetOutputSurface = _nullFunc; + __FreeOutputSurface = _nullFunc; + __FreeBloomSurfaces = _nullFunc; + + //__BulbRendererDefineNormal() + GetNormalMapSurface = _nullFunc; + DrawNormalMapDebug = _nullFunc; + __FreeNormalMapSurface = _nullFunc; + + //__BulbRendererDefineOverlayUnderlay() + __AccumulateAmbienceSprite = _nullFunc; + __AccumulateShadowOverlay = _nullFunc; + __AccumulateLightOverlay = _nullFunc; + + //__BulbRendererDefineAccumulateSoft() + __AccumulateSoftLights = _nullFunc; + + //__BulbRendererDefineAccumulateHard() + __AccumulateHardLights = _nullFunc; + + //__BulbRendererDefineVertexBuffers() + RefreshStaticOccluders = _nullFunc; + __FreeVertexBuffers = _nullFunc; + __UpdateVertexBuffers = _nullFunc; + + //__BulbRendererDefineLight() + GetLightSurface = _nullFunc; + __FreeLightSurface = _nullFunc; + GetLightValue = _nullFunc; + } - #region Accumulate hard lights + GetTonemap = function() + { + return (hdr && _system.__hdrAvailable)? hdrTonemap : ldrTonemap; + } - static __AccumulateHardLights = function(_cameraL, _cameraT, _cameraR, _cameraB, _cameraCX, _cameraCY, _cameraW, _cameraH, _normalCoeff) + __GetAmbientColor = function() { - if (__freed) return undefined; - - static _u_vLight = shader_get_uniform(__shdBulbHardShadows, "u_vLight" ); - static _u_fNormalCoeff = shader_get_uniform(__shdBulbHardShadows, "u_fNormalCoeff"); - static _sunlight_u_vLightVector = shader_get_uniform(__shdBulbHardShadowsSunlight, "u_vLightVector"); - static _sunlight_u_fNormalCoeff = shader_get_uniform(__shdBulbHardShadowsSunlight, "u_fNormalCoeff"); - - var _staticVBuffer = __staticVBuffer; - var _dynamicVBuffer = __dynamicVBuffer; - - //bm_max requires some trickery with alpha to get good-looking results - //Determine the blend mode and "default" shader accordingly - if ((mode == BULB_MODE.HARD_BM_MAX) || (mode == BULB_MODE.HARD_BM_MAX_SELFLIGHTING)) + if (GetTonemap() == BULB_TONEMAP_BAD_GAMMA) { - var _resetShader = __shdBulbPremultiplyAlpha; - gpu_set_blendmode(bm_max); - } - else - { - var _resetShader = __shdBulbPassThrough; - gpu_set_blendmode(bm_add); - } - - //Set up the coefficient to flip normals - //We use this to control self-lighting - shader_set(__shdBulbHardShadows); - shader_set_uniform_f(_u_fNormalCoeff, _normalCoeff); - - //Also do the same for our sunlight shader, provided we have any sunlight sources - if (array_length(__sunlightArray) > 0) - { - shader_set(__shdBulbHardShadowsSunlight); - shader_set_uniform_f(_sunlight_u_fNormalCoeff, _normalCoeff); - } - - //Set our default shader - shader_set(_resetShader); - - //And switch on z-testing. We'll use z-testing for stenciling - gpu_set_ztestenable(true); - gpu_set_zwriteenable(true); - gpu_set_zfunc(cmpfunc_lessequal); - - var _i = 0; - repeat(array_length(__lightsArray)) - { - var _weak = __lightsArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + if (ambientInGammaSpace) { - array_delete(__lightsArray, _i, 1); + return ambientColor; } else { - with(_weak.ref) - { - if (visible) - { - __CheckSpriteDimensions(); - - //If this light is active, do some drawing - if (__IsOnScreen(_cameraL, _cameraT, _cameraR, _cameraB)) - { - if (castShadows) - { - //Turn off all RGBA writing, leaving only z-writing - gpu_set_colorwriteenable(false, false, false, false); - - //Guarantee that we're going to write to the z-buffer with the next operations - gpu_set_zfunc(cmpfunc_always); - - //Reset z-buffer - draw_sprite_ext(sprite, image, - x, y, - xscale, yscale, angle, - c_black, 1); - - //Stencil out shadow areas - shader_set(__shdBulbHardShadows); - shader_set_uniform_f(_u_vLight, x, y); - vertex_submit(_staticVBuffer, pr_trianglelist, -1); - vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); - - //Swap to drawing RGB data (no alpha to make the output surface tidier) - gpu_set_colorwriteenable(true, true, true, false); - gpu_set_zfunc(cmpfunc_lessequal); - - //Reset shader and draw the light itself, but "behind" the shadows - shader_set(_resetShader); - draw_sprite_ext(sprite, image, - x, y, - xscale, yscale, angle, - blend, alpha); - } - else - { - //Ensure any previous changes to the z-buffer don't leak across - gpu_set_colorwriteenable(true, true, true, false); - gpu_set_zfunc(cmpfunc_always); - - //Just draw the sprite, no fancy stuff here - draw_sprite_ext(sprite, image, - x, y, - xscale, yscale, angle, - blend, alpha); - } - } - } - } - - ++_i; + return make_color_rgb(255*power(color_get_red( ambientColor)/255, 1/BULB_GAMMA), + 255*power(color_get_green(ambientColor)/255, 1/BULB_GAMMA), + 255*power(color_get_blue( ambientColor)/255, 1/BULB_GAMMA)); } } - - var _i = 0; - repeat(array_length(__sunlightArray)) + else { - var _weak = __sunlightArray[_i]; - if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + if (ambientInGammaSpace) { - array_delete(__sunlightArray, _i, 1); + return make_color_rgb(255*power(color_get_red( ambientColor)/255, BULB_GAMMA), + 255*power(color_get_green(ambientColor)/255, BULB_GAMMA), + 255*power(color_get_blue( ambientColor)/255, BULB_GAMMA)); } else { - with(_weak.ref) - { - if (visible) - { - //Turn off all RGBA writing, leaving only z-writing - gpu_set_colorwriteenable(false, false, false, false); - - //Guarantee that we're going to write to the z-buffer with the next operations - gpu_set_zfunc(cmpfunc_always); - - //Full surface clear of the z-buffer - draw_sprite_ext(__sprBulbPixel, 0, _cameraL, _cameraT, _cameraW+1, _cameraH+1, 0, c_black, 0); - - //Stencil out shadow areas - shader_set(__shdBulbHardShadowsSunlight); - shader_set_uniform_f(_sunlight_u_vLightVector, dcos(angle), -dsin(angle)); - vertex_submit(_staticVBuffer, pr_trianglelist, -1); - vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); - - //Swap to drawing RGB data (no alpha to make the output surface tidier) - gpu_set_colorwriteenable(true, true, true, false); - gpu_set_zfunc(cmpfunc_lessequal); - - //Reset shader and draw the light itself, but "behind" the shadows - shader_set(_resetShader); - draw_sprite_ext(__sprBulbPixel, 0, _cameraL, _cameraT, _cameraW+1, _cameraH+1, 0, blend, alpha); - } - } - - ++_i; + return ambientColor; } } - - gpu_set_zfunc(cmpfunc_lessequal); - gpu_set_blendmode(bm_normal); - gpu_set_ztestenable(false); - gpu_set_zwriteenable(false); } - #endregion - #region Clip Surface - static __ApplyClippingSurface = function() - { - if (__freed || !__clipEnabled) return undefined; - - var _clipSurface = GetClippingSurface(); - if (_clipSurface != undefined) - { - if (!__clipInvert) //Intended to be (!__clipInvert) - { - //Use an inverse alpha so that we paint visible areas onto the clip surface - //Inverted mode should use GameMaker's standard alpha blending - //...this makes sense if you think about it, trust me - gpu_set_blendmode_ext(bm_inv_src_alpha, bm_src_alpha); - } - - gpu_set_colorwriteenable(true, true, true, false); - - if (__clipValueToAlpha) - { - //Apply the HSV value->alpha conversion shader if so desired - shader_set(__shdBulbHSVValueToAlpha); - draw_surface_ext(_clipSurface, 0, 0, 1, 1, 0, __clipIsShadow? ambientColor : c_white, __clipAlpha); - shader_reset(); - } - else - { - draw_surface_ext(_clipSurface, 0, 0, 1, 1, 0, __clipIsShadow? ambientColor : c_white, __clipAlpha); - } - - //Reset GPU state - gpu_set_blendmode(bm_normal); - gpu_set_colorwriteenable(true, true, true, true); - } - } + //Assign the ambient colour used for the darkest areas of the screen. This can be changed on the fly + ambientColor = c_black; + ambientInGammaSpace = false; + + //The smoothing mode controls texture filtering both when accumulating lights and when drawing the resulting surface + smooth = true; + + selfLighting = false; + + soft = true; + __oldSoft = undefined; + + exposure = 1; + ldrTonemap = BULB_TONEMAP_NONE; + + __camera = undefined; + __cameraImplicit = false; + + __surfaceWidth = -1; + __surfaceHeight = -1; + + __BulbRendererDefineHDR(); + __BulbRendererDefineNormal(); + __BulbRendererDefineOverlayUnderlay(); + __BulbRendererDefineAccumulateSoft(); + if (_system.__hasStencil) __BulbRendererDefineAccumulateHard() else __BulbRendererDefineAccumulateHardNoStencil(); + __BulbRendererDefineVertexBuffers(); + __BulbRendererDefineLight(); - #endregion + SetCamera(_camera); } \ No newline at end of file diff --git a/scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.gml b/scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.gml new file mode 100644 index 0000000..e0e7ae6 --- /dev/null +++ b/scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.gml @@ -0,0 +1,9 @@ +// Feather disable all + +/// @param value +/// @param [spriteIndex] + +function BulbSpecularMapDrawSelf(_value, _spriteIndex = sprite_index) +{ + BulbSpecularMapDrawSpriteExt(_spriteIndex, image_index, x, y, image_xscale, image_yscale, image_angle, _value); +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.yy b/scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.yy new file mode 100644 index 0000000..6de7288 --- /dev/null +++ b/scripts/BulbSpecularMapDrawSelf/BulbSpecularMapDrawSelf.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbSpecularMapDrawSelf", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Specular Map", + "path": "folders/Bulb/Normal Map/Specular Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.gml b/scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.gml new file mode 100644 index 0000000..2224488 --- /dev/null +++ b/scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.gml @@ -0,0 +1,12 @@ +// Feather disable all + +/// @param sprite +/// @param image +/// @param x +/// @param y +/// @param value + +function BulbSpecularMapDrawSprite(_sprite, _image, _x, _y, _value) +{ + draw_sprite_ext(_sprite, _image, _x, _y, 1, 1, 0, c_black, _value); +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.yy b/scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.yy new file mode 100644 index 0000000..8583c79 --- /dev/null +++ b/scripts/BulbSpecularMapDrawSprite/BulbSpecularMapDrawSprite.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbSpecularMapDrawSprite", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Specular Map", + "path": "folders/Bulb/Normal Map/Specular Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.gml b/scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.gml new file mode 100644 index 0000000..bdf5d78 --- /dev/null +++ b/scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.gml @@ -0,0 +1,15 @@ +// Feather disable all + +/// @param sprite +/// @param image +/// @param x +/// @param y +/// @param xScale +/// @param yScale +/// @param angle +/// @param value + +function BulbSpecularMapDrawSpriteExt(_sprite, _image, _x, _y, _xScale, _yScale, _angle, _value) +{ + draw_sprite_ext(_sprite, _image, _x, _y, _xScale, _yScale, _angle, c_black, _value); +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.yy b/scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.yy new file mode 100644 index 0000000..53d6b38 --- /dev/null +++ b/scripts/BulbSpecularMapDrawSpriteExt/BulbSpecularMapDrawSpriteExt.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbSpecularMapDrawSpriteExt", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Specular Map", + "path": "folders/Bulb/Normal Map/Specular Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.gml b/scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.gml new file mode 100644 index 0000000..667019c --- /dev/null +++ b/scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.gml @@ -0,0 +1,8 @@ +// Feather disable all + +function BulbSpecularMapShaderReset() +{ + shader_reset(); + gpu_set_colorwriteenable(true, true, true, true); + gpu_set_blendmode(bm_normal); +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.yy b/scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.yy new file mode 100644 index 0000000..d6e4db0 --- /dev/null +++ b/scripts/BulbSpecularMapShaderReset/BulbSpecularMapShaderReset.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbSpecularMapShaderReset", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Specular Map", + "path": "folders/Bulb/Normal Map/Specular Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.gml b/scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.gml new file mode 100644 index 0000000..df9f133 --- /dev/null +++ b/scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.gml @@ -0,0 +1,10 @@ +// Feather disable all + +/// @param [forceValue=false] + +function BulbSpecularMapShaderSet(_forceValue = false) +{ + shader_set(_forceValue? __shdBulbSpecularForce : __shdBulbSpecular); + gpu_set_colorwriteenable(false, false, false, true); + gpu_set_blendmode_ext(bm_one, bm_zero); +} \ No newline at end of file diff --git a/scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.yy b/scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.yy new file mode 100644 index 0000000..d81d0d8 --- /dev/null +++ b/scripts/BulbSpecularMapShaderSet/BulbSpecularMapShaderSet.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "BulbSpecularMapShaderSet", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Specular Map", + "path": "folders/Bulb/Normal Map/Specular Map.yy", + }, +} \ No newline at end of file diff --git a/scripts/BulbStaticOccluder/BulbStaticOccluder.gml b/scripts/BulbStaticOccluder/BulbStaticOccluder.gml index aa698ee..27e0884 100644 --- a/scripts/BulbStaticOccluder/BulbStaticOccluder.gml +++ b/scripts/BulbStaticOccluder/BulbStaticOccluder.gml @@ -25,6 +25,29 @@ function BulbStaticOccluder(_renderer) constructor array_push(vertexArray, _x1, _y1, _x2, _y2, _y2-_y1, _x1-_x2); } + static AddCircle = function(_radius, _x = 0, _y = 0, _edges = 24) + { + if (__destroyed) return; + + var _angle = 0; + var _angleStep = 360 / _edges; + + var _x2 = _x + lengthdir_x(_radius, _angle); + var _y2 = _y + lengthdir_y(_radius, _angle); + + repeat(_edges) + { + _angle -= _angleStep; + + var _x1 = _x2; + var _y1 = _y2; + _x2 = _x + lengthdir_x(_radius, _angle); + _y2 = _y + lengthdir_y(_radius, _angle); + + array_push(vertexArray, _x1, _y1, _x2, _y2, _y2-_y1, _x1-_x2); + } + } + static ClearEdges = function(_x1, _y1, _x2, _y2) { if (__destroyed) return; diff --git a/scripts/BulbSunlight/BulbSunlight.gml b/scripts/BulbSunlight/BulbSunlight.gml index ec786df..0daa97e 100644 --- a/scripts/BulbSunlight/BulbSunlight.gml +++ b/scripts/BulbSunlight/BulbSunlight.gml @@ -5,9 +5,12 @@ function BulbSunlight(_renderer, _angle) constructor { visible = true; - angle = _angle; - blend = c_white; - alpha = 1.0; + normalMap = BULB_DEFAULT_USE_NORMAL_MAP; + normalMapZ = BULB_DEFAULT_NORMAL_MAP_Z; + + angle = _angle; + blend = c_white; + intensity = 1.0; penumbraSize = 0.0; diff --git a/scripts/DebugOverlay/DebugOverlay.gml b/scripts/DebugOverlay/DebugOverlay.gml index cf10c63..0048bfe 100644 --- a/scripts/DebugOverlay/DebugOverlay.gml +++ b/scripts/DebugOverlay/DebugOverlay.gml @@ -1,5 +1,19 @@ function DebugOverlay() { + var _tonemapName = "???"; + switch(renderer.GetTonemap()) + { + case BULB_TONEMAP_BAD_GAMMA: _tonemapName = "\"Bad Gamma!\"" break; + case BULB_TONEMAP_NONE: _tonemapName = "\"None\"" break; + case BULB_TONEMAP_CLAMP: _tonemapName = "\"Clamp\"" break; + case BULB_TONEMAP_REINHARD: _tonemapName = "\"Reinhard\""; break; + case BULB_TONEMAP_REINHARD_EXTENDED: _tonemapName = "\"Reinhard Extended\""; break; + case BULB_TONEMAP_UNCHARTED2: _tonemapName = "\"Uncharted 2\""; break; + case BULB_TONEMAP_ACES: _tonemapName = "\"ACES\""; break; + case BULB_TONEMAP_UNREAL3: _tonemapName = "\"Unreal 3\""; break; + case BULB_TONEMAP_HBD: _tonemapName = "\"Heji & Burgess-Dawson\""; break; + } + draw_set_color(c_white); shader_set(shdPremultiplyAlpha); gpu_set_blendenable(false); @@ -8,27 +22,27 @@ function DebugOverlay() if (showDebug) { draw_set_halign(fa_center); - draw_text(display_get_gui_width()*0.5, 25, "FPS = " + string_format(fps_real, 4, 0) + "," + string_format(smoothedFrameTime, 2, 2) + "ms / .Draw() = " + string_format(smoothedDrawEndTime, 4, 0) + "us"); + draw_text(display_get_gui_width()*0.5, 25, "FPS = " + string_format(fps_real, 4, 0) + "," + string_format(smoothedFrameTime, 2, 2) + "ms"); draw_set_halign(fa_left); - var _str = "lights = " + string(array_length(lighting.__lightsArray)); - _str += "\nstatic occluders = " + string(array_length(lighting.__staticOccludersArray)); - _str += "\ndynamic occluders = " + string(array_length(lighting.__dynamicOccludersArray)) + "\n"; + var _str = "lights = " + string(array_length(renderer.__lightsArray)); + _str += "\nstatic occluders = " + string(array_length(renderer.__staticOccludersArray)); + _str += "\ndynamic occluders = " + string(array_length(renderer.__dynamicOccludersArray)) + "\n"; - switch(lighting.mode) - { - case BULB_MODE.HARD_BM_ADD: _str += "\nrender mode = Hard z-clip, bm_add"; break; - case BULB_MODE.HARD_BM_ADD_SELFLIGHTING: _str += "\nrender mode = Hard z-clip, bm_add, self-lighting"; break; - case BULB_MODE.HARD_BM_MAX: _str += "\nrender mode = Hard z-clip, bm_max"; break; - case BULB_MODE.HARD_BM_MAX_SELFLIGHTING: _str += "\nrender mode = Hard z-clip, bm_max, self-lighting"; break; - case BULB_MODE.SOFT_BM_ADD: _str += "\nrender mode = Soft alpha-clip, bm_add"; break; - } + _str += "\nsoft = " + (renderer.soft? "true" : "false"); + _str += "\nself-renderer = " + (renderer.selfLighting? "true" : "false"); + _str += "\ntonemap = " + _tonemapName; + _str += "\nHDR = " + ((renderer.hdr && BULB_HDR_AVAILABLE)? "true" : "false"); draw_text(5, 25, _str); draw_set_valign(fa_bottom); var _str = "1: Toggle lights"; - _str += "\n2: Cycle render mode"; + _str += "\n2: Toggle soft shadow mode"; + _str += "\n3: Toggle self-renderer"; + if (BULB_HDR_AVAILABLE) _str += "\n4: Toggle HDR"; + _str += "\n5: Change tonemapping"; + _str += "\n6: Toggle normal map"; _str += "\nL: Create new disco light"; _str += "\nArrows/WASD: Move"; _str += "\nLeft click: Fire plasma"; @@ -37,17 +51,13 @@ function DebugOverlay() } else { - switch(lighting.mode) - { - case BULB_MODE.HARD_BM_ADD: var _mode = "Hard z-clip, bm_add"; break - case BULB_MODE.HARD_BM_ADD_SELFLIGHTING: var _mode = "Hard z-clip, bm_add, self-lighting"; break - case BULB_MODE.HARD_BM_MAX: var _mode = "Hard z-clip, bm_max"; break; - case BULB_MODE.HARD_BM_MAX_SELFLIGHTING: var _mode = "Hard z-clip, bm_max, self-lighting"; break; - case BULB_MODE.SOFT_BM_ADD: var _mode = "Soft alpha-clip, bm_add"; break; - } + var _mode = (renderer.soft? "soft" : "hard") + + (renderer.selfLighting? ", self-lighting" : "") + + ", tonemap=" + _tonemapName + + ((renderer.hdr && BULB_HDR_AVAILABLE)? ", HDR" : ""); draw_set_halign(fa_center); - draw_text(display_get_gui_width()*0.5, 5, "FPS = " + string_format(fps, 2, 0) + " / " + _mode + " = " + string_format(smoothedDrawEndTime, 4, 0) + "us"); + draw_text(display_get_gui_width()*0.5, 5, _mode + " // " + "FPS = " + string_format(fps, 2, 0)); draw_set_halign(fa_left); draw_set_valign(fa_bottom); @@ -57,8 +67,8 @@ function DebugOverlay() //Always credit properly :) draw_set_halign(fa_right); - var _str = "v" + __BULB_VERSION + " " + __BULB_DATE; - _str += "\nJuju Adams - @jujuadams"; + var _str = "v" + BULB_VERSION + " " + BULB_DATE; + _str += "\nJuju Adams"; _str += "\nAfter work by xot / John Leffingwell"; _str += "\nThanks to @Mordwaith and Alexey Mihailov (@LexPest)"; draw_text(display_get_gui_width() - 5, display_get_gui_height() - 5, _str); diff --git a/scripts/DebugOverlay/DebugOverlay.yy b/scripts/DebugOverlay/DebugOverlay.yy index 9578593..493a4c5 100644 --- a/scripts/DebugOverlay/DebugOverlay.yy +++ b/scripts/DebugOverlay/DebugOverlay.yy @@ -1,12 +1,11 @@ { + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "DebugOverlay", "isDnD": false, "isCompatibility": false, "parent": { "name": "Example", "path": "folders/Example.yy", }, - "resourceVersion": "1.0", - "name": "DebugOverlay", - "tags": [], - "resourceType": "GMScript", } \ No newline at end of file diff --git a/scripts/VertexCake/VertexCake.gml b/scripts/VertexCake/VertexCake.gml index c1c03f9..50a300a 100644 --- a/scripts/VertexCake/VertexCake.gml +++ b/scripts/VertexCake/VertexCake.gml @@ -6,8 +6,8 @@ //Create a basic vertex format vertex_format_begin(); vertex_format_add_position(); -vertex_format_add_texcoord(); vertex_format_add_colour(); +vertex_format_add_texcoord(); global.__vertex_cake_format = vertex_format_end(); function VertexCake() constructor @@ -59,13 +59,13 @@ function VertexCake() constructor var _lb = matrix_transform_vertex(_matrix, 0, sprite_get_height(_sprite), 0); var _rb = matrix_transform_vertex(_matrix, sprite_get_width(_sprite), sprite_get_height(_sprite), 0); - vertex_position(_vbuff, _lt[0], _lt[1]); vertex_texcoord(_vbuff, _uvs[0], _uvs[1]); vertex_colour(_vbuff, c_white, 1); - vertex_position(_vbuff, _rt[0], _rt[1]); vertex_texcoord(_vbuff, _uvs[2], _uvs[1]); vertex_colour(_vbuff, c_white, 1); - vertex_position(_vbuff, _lb[0], _lb[1]); vertex_texcoord(_vbuff, _uvs[0], _uvs[3]); vertex_colour(_vbuff, c_white, 1); - - vertex_position(_vbuff, _rt[0], _rt[1]); vertex_texcoord(_vbuff, _uvs[2], _uvs[1]); vertex_colour(_vbuff, c_white, 1); - vertex_position(_vbuff, _rb[0], _rb[1]); vertex_texcoord(_vbuff, _uvs[2], _uvs[3]); vertex_colour(_vbuff, c_white, 1); - vertex_position(_vbuff, _lb[0], _lb[1]); vertex_texcoord(_vbuff, _uvs[0], _uvs[3]); vertex_colour(_vbuff, c_white, 1); + vertex_position(_vbuff, _lt[0], _lt[1]); vertex_colour(_vbuff, c_white, 1); vertex_texcoord(_vbuff, _uvs[0], _uvs[1]); + vertex_position(_vbuff, _rt[0], _rt[1]); vertex_colour(_vbuff, c_white, 1); vertex_texcoord(_vbuff, _uvs[2], _uvs[1]); + vertex_position(_vbuff, _lb[0], _lb[1]); vertex_colour(_vbuff, c_white, 1); vertex_texcoord(_vbuff, _uvs[0], _uvs[3]); + + vertex_position(_vbuff, _rt[0], _rt[1]); vertex_colour(_vbuff, c_white, 1); vertex_texcoord(_vbuff, _uvs[2], _uvs[1]); + vertex_position(_vbuff, _rb[0], _rb[1]); vertex_colour(_vbuff, c_white, 1); vertex_texcoord(_vbuff, _uvs[2], _uvs[3]); + vertex_position(_vbuff, _lb[0], _lb[1]); vertex_colour(_vbuff, c_white, 1); vertex_texcoord(_vbuff, _uvs[0], _uvs[3]); } vertex_end(_vbuff); diff --git a/scripts/VertexCake/VertexCake.yy b/scripts/VertexCake/VertexCake.yy index 46e3710..2124adf 100644 --- a/scripts/VertexCake/VertexCake.yy +++ b/scripts/VertexCake/VertexCake.yy @@ -1,12 +1,11 @@ { + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "VertexCake", "isDnD": false, "isCompatibility": false, "parent": { "name": "Example", "path": "folders/Example.yy", }, - "resourceVersion": "1.0", - "name": "VertexCake", - "tags": [], - "resourceType": "GMScript", } \ No newline at end of file diff --git a/scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.gml b/scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.gml index 586cd79..d140c37 100644 --- a/scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.gml +++ b/scripts/__BulbAddOcclusionHard/__BulbAddOcclusionHard.gml @@ -38,5 +38,12 @@ function __BulbAddOcclusionHard(_vbuff) vertex_position_3d(_vbuff, _newAx, _newAy, 0); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_position_3d(_vbuff, _newAx, _newAy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_position_3d(_vbuff, _newBx, _newBy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); + + if (BULB_COMPENSATE_FOR_NEAR_OCCLUDERS) + { + vertex_position_3d(_vbuff, _newAx, _newAy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); + vertex_position_3d(_vbuff, 0.5*(_newAx + _newBx), 0.5*(_newAy + _newBy), 2*__BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); + vertex_position_3d(_vbuff, _newBx, _newBy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); + } } } \ No newline at end of file diff --git a/scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.gml b/scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.gml index 2a15740..a18ca81 100644 --- a/scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.gml +++ b/scripts/__BulbAddOcclusionSoft/__BulbAddOcclusionSoft.gml @@ -39,6 +39,13 @@ function __BulbAddOcclusionSoft(_vbuff) vertex_position_3d(_vbuff, _newAx, _newAy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 1, 1); vertex_position_3d(_vbuff, _newBx, _newBy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 1, 1); + if (BULB_COMPENSATE_FOR_NEAR_OCCLUDERS) + { + vertex_position_3d(_vbuff, _newAx, _newAy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 1, 1); + vertex_position_3d(_vbuff, 0.5*(_newAx + _newBx), 0.5*(_newAy + _newBy), 2*__BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 1, 1); + vertex_position_3d(_vbuff, _newBx, _newBy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 1, 1); + } + //Add data for the soft shadows vertex_position_3d(_vbuff, _newAx, _newAy, __BULB_ZFAR); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 1, 0); vertex_position_3d(_vbuff, _newAx, _newAy, 0); vertex_normal(_vbuff, _newDx, _newDy, 0); vertex_texcoord(_vbuff, 0, 1); diff --git a/scripts/__BulbConfig/__BulbConfig.gml b/scripts/__BulbConfig/__BulbConfig.gml index 3cfcce9..e59f7ea 100644 --- a/scripts/__BulbConfig/__BulbConfig.gml +++ b/scripts/__BulbConfig/__BulbConfig.gml @@ -1,9 +1,27 @@ -//Distance around the edge of the camera (in pixels) to draw dynamic occluders -//Increase this number if you have large dynamic occluders and are experiencing pop-in +// Distance around the edge of the camera (in pixels) to draw dynamic occluders. Increase this +// number if you have large dynamic occluders and are experiencing pop-in. #macro BULB_DYNAMIC_OCCLUDER_RANGE 100 -//Controls how shadow overlays (created with the BulbShadowOverlay() constructor) are drawn -//The default value is , where the HSV value (calculated as max(r,g,b)) is converted into an alpha value -//This is analogous to a lighting sprite, only when using as a shadow overlay sprite, the effect is subtractive -//If set to then the alpha channel of the sprite is used instead (and the RGB channels are ignored) -#macro BULB_SHADOW_OVERLAY_HSV_VALUE_TO_ALPHA true \ No newline at end of file +// Adds an extra triangle for each occluder to compensate for situations where a light might be +// very close to an occluder. Normally, this would cause light to bleed through the wall. Setting +// this macro to `true` will solve near-light problems but does incur a slight performance penalty. +#macro BULB_COMPENSATE_FOR_NEAR_OCCLUDERS false + +// Whether renderers, lights, and sunlight should default to having normal map support enabled. +// This saves a lot of time setting `.normalMap` on everything that you create. Enabling normal +// maps has a significant performance penalty so use this carefully. +#macro BULB_DEFAULT_USE_NORMAL_MAP false + +// The alpha threshold for sprites when drawing to the normal/specular map. Anything below this +// value will be discarded by the shader. +#macro BULB_NORMAL_MAP_ALPHA_THRESHOLD 0.5 + +// How intense the specular map effect should be. This generally is only noticeable when using HDR +// lighting. The specular map is packed into the alpha channel of the normal map surface. +#macro BULB_SPECULAR_MAP_INTENSITY 10.0 + +// The default notional "z height" for lights and sunlight. This z value is only used when +// calculating normal map influence on lights. A lower value brings the light closer to the plane, +// leading to a shallower angle of attack. This leads to more intense normal maps where the edges +// of shapes will be highlighted more strongly than the tops of shapes, especially at distance. +#macro BULB_DEFAULT_NORMAL_MAP_Z 0.2 \ No newline at end of file diff --git a/scripts/__BulbConstants/__BulbConstants.gml b/scripts/__BulbConstants/__BulbConstants.gml new file mode 100644 index 0000000..e16b301 --- /dev/null +++ b/scripts/__BulbConstants/__BulbConstants.gml @@ -0,0 +1,18 @@ +// Feather disable all + +#macro BULB_VERSION "22.0.7" +#macro BULB_DATE "2024-09-25" + +#macro BULB_TONEMAP_NONE 0 +#macro BULB_TONEMAP_CLAMP 1 +#macro BULB_TONEMAP_REINHARD 2 +#macro BULB_TONEMAP_REINHARD_EXTENDED 3 +#macro BULB_TONEMAP_UNCHARTED2 4 +#macro BULB_TONEMAP_HBD 5 +#macro BULB_TONEMAP_UNREAL3 6 +#macro BULB_TONEMAP_ACES 7 +#macro BULB_TONEMAP_BAD_GAMMA 8 + +#macro BULB_GAMMA 2.2 + +#macro BULB_HDR_AVAILABLE (__BulbSystem().__hdrAvailable) \ No newline at end of file diff --git a/scripts/__BulbConstants/__BulbConstants.yy b/scripts/__BulbConstants/__BulbConstants.yy new file mode 100644 index 0000000..8b001c8 --- /dev/null +++ b/scripts/__BulbConstants/__BulbConstants.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbConstants", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Bulb", + "path": "folders/Bulb.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbError/__BulbError.gml b/scripts/__BulbError/__BulbError.gml new file mode 100644 index 0000000..2eb9ccc --- /dev/null +++ b/scripts/__BulbError/__BulbError.gml @@ -0,0 +1,16 @@ +// Feather disable all + +function __BulbError() +{ + var _string = ""; + + var _i = 0 + repeat(argument_count) + { + _string += string(argument[_i]); + ++_i; + } + + show_debug_message("Bulb: " + string_replace_all(_string, "\n", "\n ")); + show_error("Bulb:\n" + _string + "\n ", true); +} \ No newline at end of file diff --git a/shaders/__shdBulbPassThrough/__shdBulbPassThrough.yy b/scripts/__BulbError/__BulbError.yy similarity index 66% rename from shaders/__shdBulbPassThrough/__shdBulbPassThrough.yy rename to scripts/__BulbError/__BulbError.yy index ec43a00..38867b4 100644 --- a/shaders/__shdBulbPassThrough/__shdBulbPassThrough.yy +++ b/scripts/__BulbError/__BulbError.yy @@ -1,8 +1,9 @@ { - "resourceType": "GMShader", + "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "__shdBulbPassThrough", - "type": 1, + "name": "__BulbError", + "isDnD": false, + "isCompatibility": false, "parent": { "name": "(Pay no attention to that man behind the curtain)", "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", diff --git a/scripts/__BulbRectInRect/__BulbRectInRect.gml b/scripts/__BulbRectInRect/__BulbRectInRect.gml new file mode 100644 index 0000000..fd87bf5 --- /dev/null +++ b/scripts/__BulbRectInRect/__BulbRectInRect.gml @@ -0,0 +1,6 @@ +// Feather disable all + +function __BulbRectInRect(_ax1, _ay1, _ax2, _ay2, _bx1, _by1, _bx2, _by2) +{ + return !((_bx1 > _ax2) || (_bx2 < _ax1) || (_by1 > _ay2) || (_by2 < _ay1)); +} \ No newline at end of file diff --git a/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.yy b/scripts/__BulbRectInRect/__BulbRectInRect.yy similarity index 65% rename from shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.yy rename to scripts/__BulbRectInRect/__BulbRectInRect.yy index b867c84..5b43f1b 100644 --- a/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.yy +++ b/scripts/__BulbRectInRect/__BulbRectInRect.yy @@ -1,8 +1,9 @@ { - "resourceType": "GMShader", + "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "__shdBulbHSVValueToAlpha", - "type": 1, + "name": "__BulbRectInRect", + "isDnD": false, + "isCompatibility": false, "parent": { "name": "(Pay no attention to that man behind the curtain)", "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", diff --git a/scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.gml b/scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.gml new file mode 100644 index 0000000..2343efa --- /dev/null +++ b/scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.gml @@ -0,0 +1,207 @@ +// Feather disable all + +function __BulbRendererDefineAccumulateHard() +{ + __AccumulateHardLights = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB, _cameraCX, _cameraCY, _cameraW, _cameraH, _cameraCos, _cameraSin, _normalCoeff) + { + static _shdBulbHardShadows_u_vLight = shader_get_uniform(__shdBulbHardShadows, "u_vLight" ); + static _shdBulbHardShadows_u_fNormalCoeff = shader_get_uniform(__shdBulbHardShadows, "u_fNormalCoeff"); + static _shdBulbHardShadowsSunlight_u_vLightVector = shader_get_uniform(__shdBulbHardShadowsSunlight, "u_vLightVector"); + static _shdBulbHardShadowsSunlight_u_fNormalCoeff = shader_get_uniform(__shdBulbHardShadowsSunlight, "u_fNormalCoeff"); + static _shdBulbLightWithNormalMap_u_vInfo = shader_get_uniform(__shdBulbLightWithNormalMap, "u_vInfo" ); + static _shdBulbLightWithoutNormalMap_u_fIntensity = shader_get_uniform(__shdBulbLightWithoutNormalMap, "u_fIntensity" ); + static _shdBulbSunlightWithNormalMap_u_vSunInfo = shader_get_uniform(__shdBulbSunlightWithNormalMap, "u_vInfo" ); + static _sshdBulbSunlightWithoutNormalMap_u_fIntensity = shader_get_uniform(__shdBulbSunlightWithoutNormalMap, "u_fIntensity" ); + + var _oldStencilRef = gpu_get_stencil_ref(); + var _oldStencilFunc = gpu_get_stencil_func(); + var _oldStencilPass = gpu_get_stencil_pass(); + var _oldStencilFail = gpu_get_stencil_fail(); + var _oldStencilDepthFail = gpu_get_stencil_depth_fail(); + + var _staticVBuffer = __staticVBuffer; + var _dynamicVBuffer = __dynamicVBuffer; + + var _rendererNormalMap = normalMap; + if (_rendererNormalMap) + { + shader_set(__shdBulbLightWithNormalMap); + texture_set_stage(shader_get_sampler_index(__shdBulbLightWithNormalMap, "u_sNormalMap"), surface_get_texture(GetNormalMapSurface())); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_vCamera"), _cameraCX, _cameraCY, _cameraW/2, _cameraH/2); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_vCameraVector"), _cameraCos, _cameraSin); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_fSpecularIntensity"), hdr? BULB_SPECULAR_MAP_INTENSITY : 0); + + shader_set(__shdBulbSunlightWithNormalMap); + shader_set_uniform_f(shader_get_uniform(__shdBulbSunlightWithNormalMap, "u_fSpecularIntensity"), hdr? BULB_SPECULAR_MAP_INTENSITY : 0); + } + + //bm_max requires some trickery with alpha to get good-looking results + //Determine the blend mode and "default" shader accordingly + gpu_set_blendmode(bm_add); + + //Set up the coefficient to flip normals + //We use this to control self-renderer + shader_set(__shdBulbHardShadows); + shader_set_uniform_f(_shdBulbHardShadows_u_fNormalCoeff, _normalCoeff); + + //Also do the same for our sunlight shader, provided we have any sunlight sources + if (array_length(__sunlightArray) > 0) + { + shader_set(__shdBulbHardShadowsSunlight); + shader_set_uniform_f(_shdBulbHardShadowsSunlight_u_fNormalCoeff, _normalCoeff); + } + + //Set our default shader + shader_set(__shdBulbIntensity); + + gpu_set_colorwriteenable(true, true, true, false); + + draw_clear_stencil(0); + gpu_set_stencil_enable(true); + gpu_set_stencil_pass(stencilop_replace); + gpu_set_stencil_fail(stencilop_keep); + gpu_set_stencil_depth_fail(stencilop_keep); + gpu_set_stencil_func(cmpfunc_always); + var _stencil = 0; + + var _i = 0; + repeat(array_length(__lightsArray)) + { + var _weak = __lightsArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__lightsArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + __CheckSpriteDimensions(); + + //If this light is active, do some drawing + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) + { + if (castShadows) + { + ++_stencil; + if (_stencil >= 256) + { + draw_clear_stencil(0); + _stencil = 1; + } + + gpu_set_stencil_ref(_stencil); + + //Stencil out shadow areas + shader_set(__shdBulbHardShadows); + shader_set_uniform_f(_shdBulbHardShadows_u_vLight, x, y); + + vertex_submit(_staticVBuffer, pr_trianglelist, -1); + vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); + + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbLightWithNormalMap); + shader_set_uniform_f(_shdBulbLightWithNormalMap_u_vInfo, x, y, normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + gpu_set_stencil_func(cmpfunc_greater); + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, 1); + gpu_set_stencil_func(cmpfunc_always); + } + else + { + //Just draw the sprite, no fancy stuff here + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbLightWithNormalMap); + shader_set_uniform_f(_shdBulbLightWithNormalMap_u_vInfo, x, y, normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, 1); + } + } + } + } + + ++_i; + } + } + + gpu_set_stencil_enable(true); + + var _i = 0; + repeat(array_length(__sunlightArray)) + { + var _weak = __sunlightArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__sunlightArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + ++_stencil; + if (_stencil >= 256) + { + draw_clear_stencil(0); + _stencil = 1; + } + + gpu_set_stencil_ref(_stencil); + + //Stencil out shadow areas + shader_set(__shdBulbHardShadowsSunlight); + shader_set_uniform_f(_shdBulbHardShadowsSunlight_u_vLightVector, dcos(angle), -dsin(angle)); + + vertex_submit(_staticVBuffer, pr_trianglelist, -1); + vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); + + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbSunlightWithNormalMap); + shader_set_uniform_f(_shdBulbSunlightWithNormalMap_u_vSunInfo, dcos(angle), -dsin(angle), normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + gpu_set_stencil_func(cmpfunc_greater); + draw_sprite_ext(__sprBulbPixel, 0, _boundaryL, _boundaryT, _boundaryR - _boundaryL, _boundaryB - _boundaryT, 0, blend, 1); + gpu_set_stencil_func(cmpfunc_always); + } + } + + ++_i; + } + } + + shader_reset(); + gpu_set_colorwriteenable(true, true, true, true); + gpu_set_blendmode(bm_normal); + + gpu_set_stencil_enable(false); + gpu_set_stencil_ref(_oldStencilRef); + gpu_set_stencil_func(_oldStencilFunc); + gpu_set_stencil_pass(_oldStencilPass); + gpu_set_stencil_fail(_oldStencilFail); + gpu_set_stencil_depth_fail(_oldStencilDepthFail); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.yy b/scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.yy new file mode 100644 index 0000000..990e549 --- /dev/null +++ b/scripts/__BulbRendererDefineAccumulateHard/__BulbRendererDefineAccumulateHard.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineAccumulateHard", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.gml b/scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.gml new file mode 100644 index 0000000..8452ea2 --- /dev/null +++ b/scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.gml @@ -0,0 +1,200 @@ +// Feather disable all + +function __BulbRendererDefineAccumulateHardNoStencil() +{ + __AccumulateHardLights = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB, _cameraCX, _cameraCY, _cameraW, _cameraH, _cameraCos, _cameraSin, _normalCoeff) + { + static _shdBulbHardShadows_u_vLight = shader_get_uniform(__shdBulbHardShadows, "u_vLight" ); + static _shdBulbHardShadows_u_fNormalCoeff = shader_get_uniform(__shdBulbHardShadows, "u_fNormalCoeff"); + static _shdBulbHardShadowsSunlight_u_vLightVector = shader_get_uniform(__shdBulbHardShadowsSunlight, "u_vLightVector"); + static _shdBulbHardShadowsSunlight_u_fNormalCoeff = shader_get_uniform(__shdBulbHardShadowsSunlight, "u_fNormalCoeff"); + static _shdBulbLightWithNormalMap_u_vInfo = shader_get_uniform(__shdBulbLightWithNormalMap, "u_vInfo" ); + static _shdBulbLightWithoutNormalMap_u_fIntensity = shader_get_uniform(__shdBulbLightWithoutNormalMap, "u_fIntensity" ); + static _shdBulbSunlightWithNormalMap_u_vSunInfo = shader_get_uniform(__shdBulbSunlightWithNormalMap, "u_vInfo" ); + static _sshdBulbSunlightWithoutNormalMap_u_fIntensity = shader_get_uniform(__shdBulbSunlightWithoutNormalMap, "u_fIntensity" ); + + var _staticVBuffer = __staticVBuffer; + var _dynamicVBuffer = __dynamicVBuffer; + + var _rendererNormalMap = normalMap; + if (_rendererNormalMap) + { + shader_set(__shdBulbLightWithNormalMap); + texture_set_stage(shader_get_sampler_index(__shdBulbLightWithNormalMap, "u_sNormalMap"), surface_get_texture(GetNormalMapSurface())); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_vCamera"), _cameraCX, _cameraCY, _cameraW/2, _cameraH/2); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_vCameraVector"), _cameraCos, _cameraSin); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_fSpecularIntensity"), hdr? BULB_SPECULAR_MAP_INTENSITY : 0); + + shader_set(__shdBulbSunlightWithNormalMap); + shader_set_uniform_f(shader_get_uniform(__shdBulbSunlightWithNormalMap, "u_fSpecularIntensity"), hdr? BULB_SPECULAR_MAP_INTENSITY : 0); + } + + //bm_max requires some trickery with alpha to get good-looking results + //Determine the blend mode and "default" shader accordingly + gpu_set_blendmode(bm_add); + + //Set up the coefficient to flip normals + //We use this to control self-renderer + shader_set(__shdBulbHardShadows); + shader_set_uniform_f(_shdBulbHardShadows_u_fNormalCoeff, _normalCoeff); + + //Also do the same for our sunlight shader, provided we have any sunlight sources + if (array_length(__sunlightArray) > 0) + { + shader_set(__shdBulbHardShadowsSunlight); + shader_set_uniform_f(_shdBulbHardShadowsSunlight_u_fNormalCoeff, _normalCoeff); + } + + //Set our default shader + shader_reset(); + gpu_set_colorwriteenable(true, true, true, false); + + //And switch on z-testing. We'll use z-testing for stenciling + gpu_set_ztestenable(true); + gpu_set_zwriteenable(true); + gpu_set_zfunc(cmpfunc_lessequal); + + var _i = 0; + repeat(array_length(__lightsArray)) + { + var _weak = __lightsArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__lightsArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + __CheckSpriteDimensions(); + + //If this light is active, do some drawing + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) + { + if (castShadows) + { + //Turn off all RGBA writing, leaving only z-writing + gpu_set_colorwriteenable(false, false, false, false); + + //Guarantee that we're going to write to the z-buffer with the next operations + gpu_set_zfunc(cmpfunc_always); + + //Reset z-buffer + draw_sprite_ext(sprite, image, + x, y, + xscale, yscale, angle, + c_black, 1); + + //Stencil out shadow areas + shader_set(__shdBulbHardShadows); + shader_set_uniform_f(_shdBulbHardShadows_u_vLight, x, y); + vertex_submit(_staticVBuffer, pr_trianglelist, -1); + vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); + + //Swap to drawing RGB data (no alpha to make the output surface tidier) + gpu_set_colorwriteenable(true, true, true, false); + gpu_set_zfunc(cmpfunc_lessequal); + + //Reset shader and draw the light itself, but "behind" the shadows + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbLightWithNormalMap); + shader_set_uniform_f(_shdBulbLightWithNormalMap_u_vInfo, x, y, normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, 1); + } + else + { + //Just draw the sprite, no fancy stuff here + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbLightWithNormalMap); + shader_set_uniform_f(_shdBulbLightWithNormalMap_u_vInfo, x, y, normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, 1); + } + } + } + } + + ++_i; + } + } + + var _i = 0; + repeat(array_length(__sunlightArray)) + { + var _weak = __sunlightArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__sunlightArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + //Turn off all RGBA writing, leaving only z-writing + gpu_set_colorwriteenable(false, false, false, false); + + //Guarantee that we're going to write to the z-buffer with the next operations + gpu_set_zfunc(cmpfunc_always); + + //Full surface clear of the z-buffer + draw_sprite_ext(__sprBulbPixel, 0, _boundaryL, _boundaryT, _boundaryR - _boundaryL, _boundaryB - _boundaryT, 0, c_black, 0); + + //Stencil out shadow areas + shader_set(__shdBulbHardShadowsSunlight); + shader_set_uniform_f(_shdBulbHardShadowsSunlight_u_vLightVector, dcos(angle), -dsin(angle)); + vertex_submit(_staticVBuffer, pr_trianglelist, -1); + vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); + + //Swap to drawing RGB data (no alpha to make the output surface tidier) + gpu_set_colorwriteenable(true, true, true, false); + gpu_set_zfunc(cmpfunc_lessequal); + + //Reset shader and draw the light itself, but "behind" the shado + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbSunlightWithNormalMap); + shader_set_uniform_f(_shdBulbSunlightWithNormalMap_u_vSunInfo, dcos(angle), -dsin(angle), normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + + draw_sprite_ext(__sprBulbPixel, 0, _boundaryL, _boundaryT, _boundaryR - _boundaryL, _boundaryB - _boundaryT, 0, blend, 1); + } + } + + ++_i; + } + } + + shader_reset(); + gpu_set_colorwriteenable(true, true, true, true); + gpu_set_blendmode(bm_normal); + + gpu_set_zfunc(cmpfunc_lessequal); + gpu_set_ztestenable(false); + gpu_set_zwriteenable(false); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.yy b/scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.yy new file mode 100644 index 0000000..6186f0c --- /dev/null +++ b/scripts/__BulbRendererDefineAccumulateHardNoStencil/__BulbRendererDefineAccumulateHardNoStencil.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineAccumulateHardNoStencil", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.gml b/scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.gml new file mode 100644 index 0000000..53c785b --- /dev/null +++ b/scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.gml @@ -0,0 +1,175 @@ +// Feather disable all + +function __BulbRendererDefineAccumulateSoft() +{ + __AccumulateSoftLights = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB, _cameraCX, _cameraCY, _cameraW, _cameraH, _cameraCos, _cameraSin, _normalCoeff) + { + static _shdBulbSoftShadows_u_vLight = shader_get_uniform(__shdBulbSoftShadows, "u_vLight" ); + static _shdBulbSoftShadowsSunlight_u_vLightVector = shader_get_uniform(__shdBulbSoftShadowsSunlight, "u_vLightVector"); + static _shdBulbLightWithNormalMap_u_vInfo = shader_get_uniform(__shdBulbLightWithNormalMap, "u_vInfo" ); + static _shdBulbLightWithoutNormalMap_u_fIntensity = shader_get_uniform(__shdBulbLightWithoutNormalMap, "u_fIntensity" ); + static _shdBulbSunlightWithNormalMap_u_vSunInfo = shader_get_uniform(__shdBulbSunlightWithNormalMap, "u_vInfo" ); + static _sshdBulbSunlightWithoutNormalMap_u_fIntensity = shader_get_uniform(__shdBulbSunlightWithoutNormalMap, "u_fIntensity" ); + + var _staticVBuffer = __staticVBuffer; + var _dynamicVBuffer = __dynamicVBuffer; + + var _rendererNormalMap = normalMap; + if (_rendererNormalMap) + { + shader_set(__shdBulbLightWithNormalMap); + texture_set_stage(shader_get_sampler_index(__shdBulbLightWithNormalMap, "u_sNormalMap"), surface_get_texture(GetNormalMapSurface())); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_vCamera"), _cameraCX, _cameraCY, _cameraW/2, _cameraH/2); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_vCameraVector"), _cameraCos, _cameraSin); + shader_set_uniform_f(shader_get_uniform(__shdBulbLightWithNormalMap, "u_fSpecularIntensity"), hdr? BULB_SPECULAR_MAP_INTENSITY : 0); + + shader_set(__shdBulbSunlightWithNormalMap); + shader_set_uniform_f(shader_get_uniform(__shdBulbSunlightWithNormalMap, "u_fSpecularIntensity"), hdr? BULB_SPECULAR_MAP_INTENSITY : 0); + } + + var _i = 0; + repeat(array_length(__lightsArray)) + { + var _weak = __lightsArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__lightsArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + __CheckSpriteDimensions(); + + //If this light is active, do some drawing + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) + { + if (castShadows) + { + //Only write into the alpha channel + gpu_set_colorwriteenable(false, false, false, true); + + //Clear the alpha channel for the light's visual area + gpu_set_blendmode_ext(bm_one, bm_zero); + draw_sprite_ext(sprite, image, + x, y, + xscale, yscale, angle, + c_black, 1); + + //Cut out shadows in the alpha channel + gpu_set_blendmode(bm_subtract); + + shader_set(__shdBulbSoftShadows); + shader_set_uniform_f(_shdBulbSoftShadows_u_vLight, x, y, penumbraSize); + vertex_submit(_staticVBuffer, pr_trianglelist, -1); + vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); + + //Set the light sprite to borrowing the alpha channel already on the surface + gpu_set_colorwriteenable(true, true, true, false); + gpu_set_blendmode_ext(bm_dest_alpha, bm_one); + + //Draw light sprite + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbLightWithNormalMap); + shader_set_uniform_f(_shdBulbLightWithNormalMap_u_vInfo, x, y, normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + draw_sprite_ext(sprite, image, + x, y, + xscale, yscale, angle, + blend, 1); + } + else + { + //No shadows - draw the light sprite normally + gpu_set_blendmode(bm_add); + + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbLightWithNormalMap); + shader_set_uniform_f(_shdBulbLightWithNormalMap_u_vInfo, x, y, normalMapZ, intensity); + } + else + { + shader_set(__shdBulbLightWithoutNormalMap); + shader_set_uniform_f(_shdBulbLightWithoutNormalMap_u_fIntensity, intensity); + } + + draw_sprite_ext(sprite, image, + x, y, + xscale, yscale, angle, + blend, 1); + } + } + } + } + + ++_i; + } + } + + var _i = 0; + repeat(array_length(__sunlightArray)) + { + var _weak = __sunlightArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__sunlightArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + //Only write into the alpha channel + gpu_set_colorwriteenable(false, false, false, true); + + //Clear the alpha channel for the light's visual area + gpu_set_blendmode_ext(bm_one, bm_zero); + draw_sprite_ext(__sprBulbPixel, 0, _boundaryL, _boundaryT, _boundaryR - _boundaryL, _boundaryB - _boundaryT, 0, c_black, 1); + + //Cut out shadows in the alpha channel + gpu_set_blendmode(bm_subtract); + + shader_set(__shdBulbSoftShadowsSunlight); + shader_set_uniform_f(_shdBulbSoftShadowsSunlight_u_vLightVector, dcos(angle), -dsin(angle), penumbraSize); + vertex_submit(_staticVBuffer, pr_trianglelist, -1); + vertex_submit(_dynamicVBuffer, pr_trianglelist, -1); + + //Set the light sprite to borrowing the alpha channel already on the surface + gpu_set_colorwriteenable(true, true, true, false); + gpu_set_blendmode_ext(bm_dest_alpha, bm_one); + + //Draw light sprite + if (_rendererNormalMap && normalMap) + { + shader_set(__shdBulbSunlightWithNormalMap); + shader_set_uniform_f(_shdBulbSunlightWithNormalMap_u_vSunInfo, dcos(angle), -dsin(angle), normalMapZ, intensity); + } + else + { + shader_set(__shdBulbSunlightWithoutNormalMap); + shader_set_uniform_f(_sshdBulbSunlightWithoutNormalMap_u_fIntensity, intensity); + } + + draw_sprite_ext(__sprBulbPixel, 0, _boundaryL, _boundaryT, _boundaryR - _boundaryL, _boundaryB - _boundaryT, 0, blend, 1); + } + } + + ++_i; + } + } + + shader_reset(); + gpu_set_blendmode(bm_normal); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.yy b/scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.yy new file mode 100644 index 0000000..1c58005 --- /dev/null +++ b/scripts/__BulbRendererDefineAccumulateSoft/__BulbRendererDefineAccumulateSoft.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineAccumulateSoft", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.gml b/scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.gml new file mode 100644 index 0000000..9f28da2 --- /dev/null +++ b/scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.gml @@ -0,0 +1,79 @@ +// Feather disable all + +function __BulbRendererDefineHDR() +{ + static _system = __BulbSystem(); + + hdr = false; + hdrTonemap = BULB_TONEMAP_HBD; + + hdrBloomIntensity = 0; + hdrBloomIterations = 3; + hdrBloomThresholdMin = 0.4; + hdrBloomThresholdMax = 0.9; + + __oldHDR = undefined; + __oldHDRBloomIterations = undefined; + + //Surface used for HDR composition prior to tonemapping + //This is a 16-bit float RGBA surface and is only created on demand + __outputSurface = undefined; + + __bloomSurfaceArray = []; + + + + __GetOutputSurface = function(_width, _height) + { + if ((_width <= 0) || (_height <= 0)) return undefined; + + if ((__outputSurface != undefined) && ((surface_get_width(__outputSurface) != _width) || (surface_get_height(__outputSurface) != _height))) + { + surface_free(__outputSurface); + __outputSurface = undefined; + } + + if ((__outputSurface == undefined) || !surface_exists(__outputSurface)) + { + if (hdr && _system.__hdrAvailable) + { + //Work around compile error in LTS + var _surface_create = surface_create; + __outputSurface = _surface_create(_width, _height, surface_rgba16float); + } + else + { + __outputSurface = surface_create(_width, _height); + } + + surface_set_target(__outputSurface); + draw_clear(c_black); + surface_reset_target(); + + __FreeBloomSurfaces(); + } + + return __outputSurface; + } + + __FreeOutputSurface = function() + { + if ((__outputSurface != undefined) && surface_exists(__outputSurface)) + { + surface_free(__outputSurface); + __outputSurface = undefined; + } + } + + __FreeBloomSurfaces = function() + { + var _i = 0; + repeat(array_length(__bloomSurfaceArray)) + { + surface_free(__bloomSurfaceArray[_i]); + ++_i; + } + + array_resize(__bloomSurfaceArray, 0); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.yy b/scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.yy new file mode 100644 index 0000000..b3cf516 --- /dev/null +++ b/scripts/__BulbRendererDefineHDR/__BulbRendererDefineHDR.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineHDR", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.gml b/scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.gml new file mode 100644 index 0000000..29cfed7 --- /dev/null +++ b/scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.gml @@ -0,0 +1,198 @@ +// Feather disable all + +function __BulbRendererDefineLight() +{ + //Screen-space surface for final accumulation of lights + //In HDR mode, this is a per-channel 64-bit RGBA surface + __lightSurface = undefined; + + __lightsArray = []; + __sunlightArray = []; + + GetLightSurface = function() + { + if ((__surfaceWidth <= 0) || (__surfaceHeight <= 0)) return undefined; + + var _surfaceWidth = floor(__surfaceWidth); + var _surfaceHeight = floor(__surfaceHeight); + + if ((__lightSurface != undefined) && ((surface_get_width(__lightSurface) != _surfaceWidth) || (surface_get_height(__lightSurface) != _surfaceHeight))) + { + surface_free(__lightSurface); + __lightSurface = undefined; + } + + if ((__lightSurface == undefined) || !surface_exists(__lightSurface)) + { + //Only try to create an HDR surface if floating point surfaces are available + if (_system.__hdrAvailable) + { + //Work around compile error in LTS + var _surface_create = surface_create; + __lightSurface = _surface_create(_surfaceWidth, _surfaceHeight, hdr? surface_rgba16float : surface_rgba8unorm); + } + else + { + __lightSurface = surface_create(_surfaceWidth, _surfaceHeight); + } + + surface_set_target(__lightSurface); + draw_clear_alpha(c_black, 1.0); + surface_reset_target(); + } + + return __lightSurface; + } + + __FreeLightSurface = function() + { + if ((__lightSurface != undefined) && surface_exists(__lightSurface)) + { + surface_free(__lightSurface); + __lightSurface = undefined; + } + } + + GetLightValue = function(_worldX, _worldY) + { + var _surface = GetLightSurface(); + + //Deploy PROPER MATHS in case the dev is using matrices + var _viewMatrix = camera_get_view_mat(__camera); + var _projMatrix = camera_get_proj_mat(__camera); + var _cameraW = round(abs(2/_projMatrix[0])); + var _cameraH = round(abs(2/_projMatrix[5])); + + var _vector = matrix_transform_vertex(matrix_multiply(_viewMatrix, _projMatrix), _worldX, _worldY, 0); + var _x = _cameraW * (0.5 + 0.5*_vector[0]); + var _y = _cameraH * (0.5 - 0.5*_vector[1]); //Silly GM matrix quirk + + var _result = surface_getpixel_ext(_surface, _x, _y); + if (not is_array(_result)) + { + //Unpack 32-bit colour + var _resultR = ( _result & 0xFF) / 255; + var _resultG = ((_result >> 8) & 0xFF) / 255; + var _resultB = ((_result >> 16) & 0xFF) / 255; + var _resultA = ((_result >> 24) & 0xFF) / 255; + } + else + { + //Unpack array of floating point values + var _resultR = _result[0]; + var _resultG = _result[1]; + var _resultB = _result[2]; + var _resultA = _result[3]; + } + + _resultR *= exposure; + _resultG *= exposure; + _resultB *= exposure; + _resultA = 255*clamp(_resultA, 0, 1); //Clamp the alpha channel + + static _funcLuminance = function(_red, _green, _blue) + { + return 0.2126*_red + 0.7152*_green + 0.0722*_blue; + } + + var _tonemap = GetTonemap(); + + if (_tonemap == BULB_TONEMAP_BAD_GAMMA) + { + _resultR = 255*clamp(_resultR, 0, 1); + _resultG = 255*clamp(_resultG, 0, 1); + _resultB = 255*clamp(_resultB, 0, 1); + } + else if (_tonemap == BULB_TONEMAP_HBD) + { + _resultR = max(0, _resultR - 0.004); + _resultG = max(0, _resultG - 0.004); + _resultB = max(0, _resultB - 0.004); + + _resultR = (_resultR * (6.2*_resultR + 0.5)) / (_resultR * (6.2*_resultR + 1.7) + 0.06); + _resultG = (_resultG * (6.2*_resultG + 0.5)) / (_resultG * (6.2*_resultG + 1.7) + 0.06); + _resultB = (_resultB * (6.2*_resultB + 0.5)) / (_resultB * (6.2*_resultB + 1.7) + 0.06); + + //Already includes gamma correction in calculation, no power() call needed + _resultR = 255*clamp(_resultR, 0, 1); + _resultG = 255*clamp(_resultG, 0, 1); + _resultB = 255*clamp(_resultB, 0, 1); + } + else if (_tonemap == BULB_TONEMAP_UNREAL3) + { + _resultR = _resultR / (_resultR + 0.155) * 1.019; + _resultG = _resultG / (_resultG + 0.155) * 1.019; + _resultB = _resultB / (_resultB + 0.155) * 1.019; + + //Already includes gamma correction in calculation, no power() call needed + _resultR = 255*clamp(_resultR, 0, 1); + _resultG = 255*clamp(_resultG, 0, 1); + _resultB = 255*clamp(_resultB, 0, 1); + } + else + { + if ((_tonemap == BULB_TONEMAP_NONE) || (_tonemap == BULB_TONEMAP_CLAMP)) + { + //Nothing else needed + } + else if (_tonemap == BULB_TONEMAP_REINHARD) + { + var _luminance = _funcLuminance(_resultR, _resultG, _resultB); + var _luminanceNew = _luminance / (1 + _luminance); + + _resultR *= _luminanceNew / _luminance; + _resultG *= _luminanceNew / _luminance; + _resultB *= _luminanceNew / _luminance; + } + else if (_tonemap == BULB_TONEMAP_REINHARD_EXTENDED) + { + var _luminance = _funcLuminance(_resultR, _resultG, _resultB); + var _luminanceNew = _luminance * (1.0 + (_luminance / (4*4))) / (1 + _luminance); + + _resultR *= _luminanceNew / _luminance; + _resultG *= _luminanceNew / _luminance; + _resultB *= _luminanceNew / _luminance; + } + else if (_tonemap == BULB_TONEMAP_UNCHARTED2) + { + _resultR *= 4; + _resultG *= 4; + _resultB *= 4; + + static _uc2_A = 0.15; + static _uc2_B = 0.50; + static _uc2_C = 0.10; + static _uc2_D = 0.20; + static _uc2_E = 0.02; + static _uc2_F = 0.30; + + _resultR = ((_resultR*(_uc2_A*_resultR + _uc2_C*_uc2_B) + _uc2_D*_uc2_E) / (_resultR*(_uc2_A*_resultR + _uc2_B) + _uc2_D*_uc2_F)) - _uc2_E/_uc2_F; + _resultG = ((_resultG*(_uc2_A*_resultG + _uc2_C*_uc2_B) + _uc2_D*_uc2_E) / (_resultG*(_uc2_A*_resultG + _uc2_B) + _uc2_D*_uc2_F)) - _uc2_E/_uc2_F; + _resultB = ((_resultB*(_uc2_A*_resultB + _uc2_C*_uc2_B) + _uc2_D*_uc2_E) / (_resultB*(_uc2_A*_resultB + _uc2_B) + _uc2_D*_uc2_F)) - _uc2_E/_uc2_F; + } + else if (_tonemap == BULB_TONEMAP_UNREAL3) + { + _resultR = max(0, _resultR - 0.004); + _resultG = max(0, _resultG - 0.004); + _resultB = max(0, _resultB - 0.004); + + _resultR = (_resultR * (6.2*_resultR + 0.5)) / (_resultR * (6.2*_resultR + 1.7) + 0.06); + _resultG = (_resultG * (6.2*_resultG + 0.5)) / (_resultG * (6.2*_resultG + 1.7) + 0.06); + _resultB = (_resultB * (6.2*_resultB + 0.5)) / (_resultB * (6.2*_resultB + 1.7) + 0.06); + } + else if (_tonemap == BULB_TONEMAP_ACES) + { + _resultR = (_resultR*(2.51*_resultR + 0.03)) / (_resultR*(2.43*_resultR + 0.59) + 0.14); + _resultG = (_resultG*(2.51*_resultG + 0.03)) / (_resultG*(2.43*_resultG + 0.59) + 0.14); + _resultB = (_resultB*(2.51*_resultB + 0.03)) / (_resultB*(2.43*_resultB + 0.59) + 0.14); + } + + //Final gamma correction stage + _resultR = 255*clamp(power(_resultR, 1/BULB_GAMMA), 0, 1); + _resultG = 255*clamp(power(_resultG, 1/BULB_GAMMA), 0, 1); + _resultB = 255*clamp(power(_resultB, 1/BULB_GAMMA), 0, 1); + } + + return ((_resultA << 24) | (_resultB << 16) | (_resultG << 8) | _resultR); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.yy b/scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.yy new file mode 100644 index 0000000..8412f38 --- /dev/null +++ b/scripts/__BulbRendererDefineLight/__BulbRendererDefineLight.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineLight", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.gml b/scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.gml new file mode 100644 index 0000000..7869689 --- /dev/null +++ b/scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.gml @@ -0,0 +1,52 @@ +// Feather disable all + +function __BulbRendererDefineNormal() +{ + normalMap = BULB_DEFAULT_USE_NORMAL_MAP; + __oldNormalMap = undefined; + + __normalSurface = undefined; + + + + GetNormalMapSurface = function() + { + if (not normalMap) + { + __BulbError("Cannot call .GetNormalMapSurface(), `normalMap` is not set to `true`"); + } + + if ((__surfaceWidth <= 0) || (__surfaceHeight <= 0)) return undefined; + + if ((__normalSurface != undefined) && ((surface_get_width(__normalSurface) != __surfaceWidth) || (surface_get_height(__normalSurface) != __surfaceHeight))) + { + surface_free(__normalSurface); + __normalSurface = undefined; + } + + if ((__normalSurface == undefined) || !surface_exists(__normalSurface)) + { + __normalSurface = surface_create(__surfaceWidth, __surfaceHeight); + + surface_set_target(__normalSurface); + BulbNormalMapClear(); + surface_reset_target(); + } + + return __normalSurface; + } + + DrawNormalMapDebug = function(_x, _y, _width, _height) + { + draw_surface_stretched(GetNormalMapSurface(), _x, _y, _width, _height); + } + + __FreeNormalMapSurface = function() + { + if ((__normalSurface != undefined) && surface_exists(__normalSurface)) + { + surface_free(__normalSurface); + __normalSurface = undefined; + } + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.yy b/scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.yy new file mode 100644 index 0000000..e085c42 --- /dev/null +++ b/scripts/__BulbRendererDefineNormal/__BulbRendererDefineNormal.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineNormal", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.gml b/scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.gml new file mode 100644 index 0000000..37bfb9b --- /dev/null +++ b/scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.gml @@ -0,0 +1,141 @@ +// Feather disable all + +function __BulbRendererDefineOverlayUnderlay() +{ + __ambienceSpriteArray = []; + __shadowOverlayArray = []; + __lightOverlayArray = []; + + __AccumulateAmbienceSprite = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB) + { + //Now draw ambience overlay sprites, if we have any + var _size = array_length(__ambienceSpriteArray); + if (_size > 0) + { + gpu_set_colorwriteenable(true, true, true, false); + + var _i = 0; + repeat(_size) + { + var _weak = __ambienceSpriteArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__ambienceSpriteArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + __CheckSpriteDimensions(); + + //If this light is active, do some drawing + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) + { + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, alpha); + } + } + } + + ++_i; + } + } + + gpu_set_colorwriteenable(true, true, true, true); + } + } + + __AccumulateShadowOverlay = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB) + { + //Now draw shadow overlay sprites, if we have any + var _size = array_length(__shadowOverlayArray); + if (_size > 0) + { + //Leverage the fog system to force the colour of the sprites we draw (alpha channel passes through) + gpu_set_fog(true, __GetAmbientColor(), 0, 0); + + //Don't touch the alpha channel + gpu_set_colorwriteenable(true, true, true, false); + + var _i = 0; + repeat(_size) + { + var _weak = __shadowOverlayArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__shadowOverlayArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + __CheckSpriteDimensions(); + + //If this light is active, do some drawing + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) + { + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, c_white, alpha); + } + } + } + + ++_i; + } + } + + //Reset render state + gpu_set_fog(false, c_white, 0, 0); + gpu_set_colorwriteenable(true, true, true, true); + } + } + + __AccumulateLightOverlay = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB) + { + static _u_fIntensity = shader_get_uniform(__shdBulbIntensity, "u_fIntensity"); + + shader_set(__shdBulbIntensity); + + //We use the overarching blend mode for the renderer + gpu_set_blendmode(bm_add); + + //Don't touch the alpha channel though + gpu_set_colorwriteenable(true, true, true, false); + + var _i = 0; + repeat(array_length(__lightOverlayArray)) + { + var _weak = __lightOverlayArray[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(__lightOverlayArray, _i, 1); + } + else + { + with(_weak.ref) + { + if (visible) + { + __CheckSpriteDimensions(); + + //If this light is active, do some drawing + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) + { + shader_set_uniform_f(_u_fIntensity, intensity); + draw_sprite_ext(sprite, image, x, y, xscale, yscale, angle, blend, 1); + } + } + } + + ++_i; + } + } + + //Reset render state + shader_reset(); + gpu_set_fog(false, c_white, 0, 0); + gpu_set_colorwriteenable(true, true, true, true); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.yy b/scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.yy new file mode 100644 index 0000000..388226b --- /dev/null +++ b/scripts/__BulbRendererDefineOverlayUnderlay/__BulbRendererDefineOverlayUnderlay.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineOverlayUnderlay", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.gml b/scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.gml new file mode 100644 index 0000000..7ec71b2 --- /dev/null +++ b/scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.gml @@ -0,0 +1,148 @@ +// Feather disable all + +function __BulbRendererDefineVertexBuffers() +{ + __staticVBuffer = undefined; //Vertex buffer describing the geometry of static occluder objects + __dynamicVBuffer = undefined; //As above but for dynamic shadow occluders. This is updated every step + + __staticOccludersArray = []; + __dynamicOccludersArray = []; + + RefreshStaticOccluders = function() + { + if (__staticVBuffer != undefined) + { + vertex_delete_buffer(__staticVBuffer); + __staticVBuffer = undefined; + } + } + + __FreeVertexBuffers = function() + { + if (__staticVBuffer != undefined) + { + vertex_delete_buffer(__staticVBuffer); + __staticVBuffer = undefined; + } + + if (__dynamicVBuffer != undefined) + { + vertex_delete_buffer(__dynamicVBuffer); + __dynamicVBuffer = undefined; + } + } + + __UpdateVertexBuffers = function(_boundaryL, _boundaryT, _boundaryR, _boundaryB) + { + //One-time construction of the static occluder geometry + if (__staticVBuffer == undefined) + { + //Create a new vertex buffer + __staticVBuffer = vertex_create_buffer(); + var _staticVBuffer = __staticVBuffer; + + //Add static shadow caster vertices to the relevant vertex buffer + if (soft) + { + vertex_begin(__staticVBuffer, _vformat3DNormalTex); + + var _array = __staticOccludersArray; + var _i = 0; + repeat(array_length(_array)) + { + var _weak = _array[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(_array, _i, 1); + } + else + { + with(_weak.ref) __BulbAddOcclusionSoft(_staticVBuffer); + ++_i; + } + } + } + else + { + vertex_begin(__staticVBuffer, _vformat3DNormal); + + var _array = __staticOccludersArray; + var _i = 0; + repeat(array_length(_array)) + { + var _weak = _array[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(_array, _i, 1); + } + else + { + with(_weak.ref) __BulbAddOcclusionHard(_staticVBuffer); + ++_i; + } + } + } + + vertex_end(__staticVBuffer); + + //Freeze this buffer for speed boosts later on (though only if we have vertices in this buffer) + if (vertex_get_number(__staticVBuffer) > 0) vertex_freeze(__staticVBuffer); + } + + //Refresh the dynamic occluder geometry + if (__dynamicVBuffer == undefined) __dynamicVBuffer = vertex_create_buffer(); + var _dynamicVBuffer = __dynamicVBuffer; + + //Add dynamic occluder vertices to the relevant vertex buffer + if (soft) + { + vertex_begin(_dynamicVBuffer, _vformat3DNormalTex); + + var _array = __dynamicOccludersArray; + var _i = 0; + repeat(array_length(_array)) + { + var _weak = _array[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(_array, _i, 1); + } + else + { + with(_weak.ref) + { + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) __BulbAddOcclusionSoft(_dynamicVBuffer); + } + + ++_i; + } + } + } + else + { + vertex_begin(_dynamicVBuffer, _vformat3DNormal); + + var _array = __dynamicOccludersArray; + var _i = 0; + repeat(array_length(_array)) + { + var _weak = _array[_i]; + if (!weak_ref_alive(_weak) || _weak.ref.__destroyed) + { + array_delete(_array, _i, 1); + } + else + { + with(_weak.ref) + { + if (__IsOnScreen(_boundaryL, _boundaryT, _boundaryR, _boundaryB)) __BulbAddOcclusionHard(_dynamicVBuffer); + } + + ++_i; + } + } + } + + vertex_end(_dynamicVBuffer); + } +} \ No newline at end of file diff --git a/scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.yy b/scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.yy new file mode 100644 index 0000000..55e5920 --- /dev/null +++ b/scripts/__BulbRendererDefineVertexBuffers/__BulbRendererDefineVertexBuffers.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbRendererDefineVertexBuffers", + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "Renderer Definitions", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Renderer Definitions.yy", + }, +} \ No newline at end of file diff --git a/scripts/__BulbSystem/__BulbSystem.gml b/scripts/__BulbSystem/__BulbSystem.gml index 64791f9..46d12a7 100644 --- a/scripts/__BulbSystem/__BulbSystem.gml +++ b/scripts/__BulbSystem/__BulbSystem.gml @@ -1,53 +1,54 @@ -#macro __BULB_VERSION "21.0.1" -#macro __BULB_DATE "2023-12-09" -#macro __BULB_ZFAR 1 - -__BulbTrace("Welcome to Bulb by Juju Adams! This is version " + __BULB_VERSION + ", " + __BULB_DATE); - -//Create a couple vertex formats -vertex_format_begin(); -vertex_format_add_position_3d(); -vertex_format_add_normal(); -global.__bulbFormat3DNormal = vertex_format_end(); - -vertex_format_begin(); -vertex_format_add_position_3d(); -vertex_format_add_normal(); -vertex_format_add_texcoord(); -global.__bulbFormat3DNormalTex = vertex_format_end(); - - - -function __BulbTrace() +// HDR references: +// https://www.shadertoy.com/view/WdjSW3 +// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ +// https://64.github.io/tonemapping/ +// http://slideshare.net/ozlael/hable-john-uncharted2-hdr-renderer +// http://filmicgames.com/archives/75 +// http://filmicgames.com/archives/183 +// http://filmicgames.com/archives/190 +// http://imdoingitwrong.wordpress.com/2010/08/19/why-reinhard-desaturates-my-blacks-3/ +// http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/ +// http://renderwonk.com/publications/s2010-color-course/ +// https://mini.gmshaders.com/p/tonemaps +// http://filmicworlds.com/blog/filmic-tonemapping-operators/ + +#macro __BULB_ZFAR 1 + +function __BulbSystem() { - var _string = ""; + static _system = undefined; + if (_system != undefined) return _system; - var _i = 0; - repeat(argument_count) - { - _string += string(argument[_i]); - ++_i; - } - - show_debug_message("Bulb: " + _string); -} - -function __BulbError() -{ - var _string = ""; + __BulbTrace("Welcome to Bulb by Juju Adams! This is version " + BULB_VERSION + ", " + BULB_DATE); - var _i = 0 - repeat(argument_count) + _system = {}; + with(_system) { - _string += string(argument[_i]); - ++_i; + try + { + var _ = surface_rgba16float; + + __BulbTrace("HDR available"); + __hdrAvailable = true; + } + catch(_error) + { + __BulbTrace("HDR not available"); + __hdrAvailable = false; + } + + try + { + gpu_get_stencil_ref(); + __BulbTrace("GPU stencil functions available"); + __hasStencil = true; + } + catch(_error) + { + __BulbTrace("GPU stencil functions not available"); + __hasStencil = false; + } } - show_debug_message("Bulb: " + string_replace_all(_string, "\n", "\n ")); - show_error("Bulb:\n" + _string + "\n ", true); -} - -function __BulbRectInRect(_ax1, _ay1, _ax2, _ay2, _bx1, _by1, _bx2, _by2) -{ - return !((_bx1 > _ax2) || (_bx2 < _ax1) || (_by1 > _ay2) || (_by2 < _ay1)); + return _system; } \ No newline at end of file diff --git a/scripts/__BulbTrace/__BulbTrace.gml b/scripts/__BulbTrace/__BulbTrace.gml new file mode 100644 index 0000000..dc580d7 --- /dev/null +++ b/scripts/__BulbTrace/__BulbTrace.gml @@ -0,0 +1,15 @@ +// Feather disable all + +function __BulbTrace() +{ + var _string = ""; + + var _i = 0; + repeat(argument_count) + { + _string += string(argument[_i]); + ++_i; + } + + show_debug_message("Bulb: " + _string); +} \ No newline at end of file diff --git a/shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.yy b/scripts/__BulbTrace/__BulbTrace.yy similarity index 66% rename from shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.yy rename to scripts/__BulbTrace/__BulbTrace.yy index 1a762d0..3d7b966 100644 --- a/shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.yy +++ b/scripts/__BulbTrace/__BulbTrace.yy @@ -1,11 +1,11 @@ { - "type": 1, + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__BulbTrace", + "isDnD": false, + "isCompatibility": false, "parent": { "name": "(Pay no attention to that man behind the curtain)", "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", }, - "resourceVersion": "1.0", - "name": "__shdBulbPremultiplyAlpha", - "tags": [], - "resourceType": "GMShader", } \ No newline at end of file diff --git a/shaders/__shdBulbFinalRender/__shdBulbFinalRender.fsh b/shaders/__shdBulbFinalRender/__shdBulbFinalRender.fsh deleted file mode 100644 index eb2fbb7..0000000 --- a/shaders/__shdBulbFinalRender/__shdBulbFinalRender.fsh +++ /dev/null @@ -1,9 +0,0 @@ -varying vec2 v_vTexcoord; -varying vec4 v_vColour; - -void main() -{ - vec4 sample = texture2D(gm_BaseTexture, v_vTexcoord); - gl_FragColor = v_vColour*vec4(sample.rgb, 1.0); - gl_FragColor.rgb *= gl_FragColor.a; -} diff --git a/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.fsh b/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.fsh deleted file mode 100644 index ffbbfa1..0000000 --- a/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.fsh +++ /dev/null @@ -1,8 +0,0 @@ -varying vec2 v_vTexcoord; -varying vec4 v_vColour; - -void main() -{ - vec3 sample = texture2D(gm_BaseTexture, v_vTexcoord).rgb; - gl_FragColor = vec4(v_vColour.rgb, v_vColour.a*max(sample.r, max(sample.g, sample.b))); -} \ No newline at end of file diff --git a/shaders/__shdBulbHardShadows/__shdBulbHardShadows.vsh b/shaders/__shdBulbHardShadows/__shdBulbHardShadows.vsh index c08db0d..792ab16 100644 --- a/shaders/__shdBulbHardShadows/__shdBulbHardShadows.vsh +++ b/shaders/__shdBulbHardShadows/__shdBulbHardShadows.vsh @@ -1,6 +1,6 @@ precision highp float; -#define MAX_LENGTH 50.0 +#define MAX_LENGTH 500.0 attribute vec3 in_Position; attribute vec3 in_Normal; diff --git a/shaders/__shdBulbHardShadows/__shdBulbHardShadows.yy b/shaders/__shdBulbHardShadows/__shdBulbHardShadows.yy index dd715b8..98d1c6a 100644 --- a/shaders/__shdBulbHardShadows/__shdBulbHardShadows.yy +++ b/shaders/__shdBulbHardShadows/__shdBulbHardShadows.yy @@ -4,7 +4,7 @@ "name": "__shdBulbHardShadows", "type": 1, "parent": { - "name": "(Pay no attention to that man behind the curtain)", - "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", + "name": "Shadow", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Shadow.yy", }, } \ No newline at end of file diff --git a/shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy b/shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy index eed5c5e..e543ca4 100644 --- a/shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy +++ b/shaders/__shdBulbHardShadowsSunlight/__shdBulbHardShadowsSunlight.yy @@ -4,7 +4,7 @@ "name": "__shdBulbHardShadowsSunlight", "type": 1, "parent": { - "name": "(Pay no attention to that man behind the curtain)", - "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", + "name": "Shadow", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Shadow.yy", }, } \ No newline at end of file diff --git a/shaders/__shdBulbPassThrough/__shdBulbPassThrough.fsh b/shaders/__shdBulbIntensity/__shdBulbIntensity.fsh similarity index 67% rename from shaders/__shdBulbPassThrough/__shdBulbPassThrough.fsh rename to shaders/__shdBulbIntensity/__shdBulbIntensity.fsh index 1e3903b..6e36c46 100644 --- a/shaders/__shdBulbPassThrough/__shdBulbPassThrough.fsh +++ b/shaders/__shdBulbIntensity/__shdBulbIntensity.fsh @@ -1,7 +1,10 @@ varying vec2 v_vTexcoord; varying vec4 v_vColour; +uniform float u_fIntensity; + void main() { gl_FragColor = v_vColour * texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb *= u_fIntensity; } \ No newline at end of file diff --git a/shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.vsh b/shaders/__shdBulbIntensity/__shdBulbIntensity.vsh similarity index 90% rename from shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.vsh rename to shaders/__shdBulbIntensity/__shdBulbIntensity.vsh index d48bfbe..cb82510 100644 --- a/shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.vsh +++ b/shaders/__shdBulbIntensity/__shdBulbIntensity.vsh @@ -8,6 +8,6 @@ varying vec4 v_vColour; void main() { gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); - v_vColour = in_Colour; + v_vColour = in_Colour; v_vTexcoord = in_TextureCoord; } \ No newline at end of file diff --git a/shaders/__shdBulbFinalRender/__shdBulbFinalRender.yy b/shaders/__shdBulbIntensity/__shdBulbIntensity.yy similarity index 53% rename from shaders/__shdBulbFinalRender/__shdBulbFinalRender.yy rename to shaders/__shdBulbIntensity/__shdBulbIntensity.yy index f9269cb..e01361f 100644 --- a/shaders/__shdBulbFinalRender/__shdBulbFinalRender.yy +++ b/shaders/__shdBulbIntensity/__shdBulbIntensity.yy @@ -1,11 +1,10 @@ { + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbIntensity", "type": 1, "parent": { - "name": "(Pay no attention to that man behind the curtain)", - "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", }, - "resourceVersion": "1.0", - "name": "__shdBulbFinalRender", - "tags": [], - "resourceType": "GMShader", } \ No newline at end of file diff --git a/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.fsh b/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.fsh new file mode 100644 index 0000000..89389a5 --- /dev/null +++ b/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.fsh @@ -0,0 +1,12 @@ +varying vec2 v_vTexcoord; + +uniform vec2 u_vTexel; + +void main() +{ + gl_FragColor = (4.0*texture2D(gm_BaseTexture, v_vTexcoord ) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( u_vTexel.x, 0.0)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2(-u_vTexel.x, 0.0)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( 0.0, u_vTexel.y)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( 0.0, -u_vTexel.y))) / 8.0; +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.vsh b/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.vsh new file mode 100644 index 0000000..a7ac6b9 --- /dev/null +++ b/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.vsh @@ -0,0 +1,11 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.yy b/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.yy new file mode 100644 index 0000000..feeea51 --- /dev/null +++ b/shaders/__shdBulbKawaseDown/__shdBulbKawaseDown.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbKawaseDown", + "type": 1, + "parent": { + "name": "Kawase", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Kawase.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.fsh b/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.fsh new file mode 100644 index 0000000..efce4e7 --- /dev/null +++ b/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.fsh @@ -0,0 +1,20 @@ +varying vec2 v_vTexcoord; + +uniform vec2 u_vThreshold; +uniform vec2 u_vTexel; + +float Luminance(vec3 color) +{ + return dot(color, vec3(0.2126, 0.7152, 0.0722)); +} + +void main() +{ + gl_FragColor = (4.0*texture2D(gm_BaseTexture, v_vTexcoord ) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( u_vTexel.x, 0.0)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2(-u_vTexel.x, 0.0)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( 0.0, u_vTexel.y)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( 0.0, -u_vTexel.y))) / 8.0; + + gl_FragColor.rgb *= smoothstep(u_vThreshold.x, u_vThreshold.y, Luminance(gl_FragColor.rgb)); +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.vsh b/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.vsh new file mode 100644 index 0000000..a7ac6b9 --- /dev/null +++ b/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.vsh @@ -0,0 +1,11 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.yy b/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.yy new file mode 100644 index 0000000..ddac3ae --- /dev/null +++ b/shaders/__shdBulbKawaseDownWithThreshold/__shdBulbKawaseDownWithThreshold.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbKawaseDownWithThreshold", + "type": 1, + "parent": { + "name": "Kawase", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Kawase.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.fsh b/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.fsh new file mode 100644 index 0000000..8363040 --- /dev/null +++ b/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.fsh @@ -0,0 +1,15 @@ +varying vec2 v_vTexcoord; + +uniform vec2 u_vTexel; + +void main() +{ + gl_FragColor = ( texture2D(gm_BaseTexture, v_vTexcoord + vec2( 2.0*u_vTexel.x, 0.0)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2(-2.0*u_vTexel.x, 0.0)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( 0.0, 2.0*u_vTexel.y)) + + texture2D(gm_BaseTexture, v_vTexcoord + vec2( 0.0,-2.0*u_vTexel.y)) + + 2.0*texture2D(gm_BaseTexture, v_vTexcoord + vec2( u_vTexel.x, u_vTexel.y)) + + 2.0*texture2D(gm_BaseTexture, v_vTexcoord + vec2( -u_vTexel.x, u_vTexel.y)) + + 2.0*texture2D(gm_BaseTexture, v_vTexcoord + vec2( u_vTexel.x, -u_vTexel.y)) + + 2.0*texture2D(gm_BaseTexture, v_vTexcoord + vec2( -u_vTexel.x, -u_vTexel.y))) / 12.0; +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.vsh b/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.vsh new file mode 100644 index 0000000..a7ac6b9 --- /dev/null +++ b/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.vsh @@ -0,0 +1,11 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.yy b/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.yy new file mode 100644 index 0000000..05a916e --- /dev/null +++ b/shaders/__shdBulbKawaseUp/__shdBulbKawaseUp.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbKawaseUp", + "type": 1, + "parent": { + "name": "Kawase", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Kawase.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.fsh b/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.fsh new file mode 100644 index 0000000..02e7de8 --- /dev/null +++ b/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.fsh @@ -0,0 +1,29 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; +varying vec2 v_vPosition; + +uniform sampler2D u_sNormalMap; +uniform vec2 u_vCameraVector; //cos, sin +uniform vec4 u_vInfo; +uniform vec4 u_vCamera; +uniform float u_fSpecularIntensity; + +void main() +{ + #ifdef _YY_HLSL11_ + vec2 objectPos = v_vPosition*vec2(1.0, -1.0); + #else + vec2 objectPos = v_vPosition; + #endif + + vec3 lightPos = vec3((u_vInfo.xy - u_vCamera.xy) / u_vCamera.zw, u_vInfo.z); + + vec4 normalSpecular = texture2D(u_sNormalMap, 0.5 + 0.5*objectPos); + vec3 normal = 2.0*normalSpecular.xyz - 1.0; + normal.xy = mat2(u_vCameraVector.x, -u_vCameraVector.y, u_vCameraVector.y, u_vCameraVector.x)*normal.xy; + + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb *= u_vInfo.w*((u_fSpecularIntensity*(1.0 - normalSpecular.w) + 1.0)*max(0.0, dot(normalize(lightPos - vec3(objectPos, 0.0)), normal))); + + gl_FragColor.rgb *= u_vInfo.w*(u_fSpecularIntensity*(1.0 - normalSpecular.w) + 1.0); +} \ No newline at end of file diff --git a/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.vsh b/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.vsh new file mode 100644 index 0000000..daa3ccd --- /dev/null +++ b/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.vsh @@ -0,0 +1,15 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; +varying vec2 v_vPosition; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; + v_vPosition = gl_Position.xy; +} \ No newline at end of file diff --git a/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.yy b/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.yy new file mode 100644 index 0000000..0d34ab1 --- /dev/null +++ b/shaders/__shdBulbLightWithNormalMap/__shdBulbLightWithNormalMap.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbLightWithNormalMap", + "type": 1, + "parent": { + "name": "Light", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Light.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.fsh b/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.fsh similarity index 67% rename from shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.fsh rename to shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.fsh index b9f5616..6e36c46 100644 --- a/shaders/__shdBulbPremultiplyAlpha/__shdBulbPremultiplyAlpha.fsh +++ b/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.fsh @@ -1,8 +1,10 @@ varying vec2 v_vTexcoord; varying vec4 v_vColour; +uniform float u_fIntensity; + void main() { gl_FragColor = v_vColour * texture2D(gm_BaseTexture, v_vTexcoord); - gl_FragColor.rgb *= gl_FragColor.a; + gl_FragColor.rgb *= u_fIntensity; } \ No newline at end of file diff --git a/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.vsh b/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.vsh similarity index 90% rename from shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.vsh rename to shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.vsh index d48bfbe..cb82510 100644 --- a/shaders/__shdBulbHSVValueToAlpha/__shdBulbHSVValueToAlpha.vsh +++ b/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.vsh @@ -8,6 +8,6 @@ varying vec4 v_vColour; void main() { gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); - v_vColour = in_Colour; + v_vColour = in_Colour; v_vTexcoord = in_TextureCoord; } \ No newline at end of file diff --git a/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.yy b/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.yy new file mode 100644 index 0000000..1d446f3 --- /dev/null +++ b/shaders/__shdBulbLightWithoutNormalMap/__shdBulbLightWithoutNormalMap.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbLightWithoutNormalMap", + "type": 1, + "parent": { + "name": "Light", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Light.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.fsh b/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.fsh new file mode 100644 index 0000000..b576fd4 --- /dev/null +++ b/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.fsh @@ -0,0 +1,8 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(1.0/2.2)); +} \ No newline at end of file diff --git a/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.vsh b/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.yy b/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.yy new file mode 100644 index 0000000..4718006 --- /dev/null +++ b/shaders/__shdBulbLinearToGamma/__shdBulbLinearToGamma.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbLinearToGamma", + "type": 1, + "parent": { + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbNormal/__shdBulbNormal.fsh b/shaders/__shdBulbNormal/__shdBulbNormal.fsh new file mode 100644 index 0000000..965e0e2 --- /dev/null +++ b/shaders/__shdBulbNormal/__shdBulbNormal.fsh @@ -0,0 +1,30 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fAlphaThreshold; +uniform float u_fDisable; + +const float twoPi = 2.0*3.14159265; +const float conversion = twoPi / (257.0 + (1.0 / 63.0)); + +void main() +{ + gl_FragColor = texture2D(gm_BaseTexture, v_vTexcoord); + if (gl_FragColor.a < u_fAlphaThreshold) discard; + gl_FragColor.a = 1.0; + + gl_FragColor.rgb = 2.0*gl_FragColor.rgb - 1.0; + + //Use the least significant bits in the red channel for the + float xFlip = mod(v_vColour.r*255.0, 2.0); + float yFlip = mod((v_vColour.r*255.0 - xFlip) / 2.0, 2.0); + + //Technically we should remove the least significant bits (the x flip and y flip bits) + //Ultimately, it doesn't change the outcome much + float angle = dot(v_vColour.rgb, conversion*vec3(1.0/63.0, 1.0, 256.0)); + float sine = sin(angle); + float cosine = cos(angle); + mat2 matrix = mat2(cosine, -sine, sine, cosine)*(mat2(1.0 - 2.0*xFlip, 0.0, 0.0, 1.0 - 2.0*yFlip)); + + gl_FragColor.rg = 0.5 + 0.5*(matrix*gl_FragColor.rg); +} \ No newline at end of file diff --git a/shaders/__shdBulbFinalRender/__shdBulbFinalRender.vsh b/shaders/__shdBulbNormal/__shdBulbNormal.vsh similarity index 82% rename from shaders/__shdBulbFinalRender/__shdBulbFinalRender.vsh rename to shaders/__shdBulbNormal/__shdBulbNormal.vsh index 9551f50..c0500b7 100644 --- a/shaders/__shdBulbFinalRender/__shdBulbFinalRender.vsh +++ b/shaders/__shdBulbNormal/__shdBulbNormal.vsh @@ -7,8 +7,7 @@ varying vec4 v_vColour; void main() { - gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position, 1.0); - - v_vColour = in_Colour; + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; v_vTexcoord = in_TextureCoord; } diff --git a/shaders/__shdBulbNormal/__shdBulbNormal.yy b/shaders/__shdBulbNormal/__shdBulbNormal.yy new file mode 100644 index 0000000..5d6aa38 --- /dev/null +++ b/shaders/__shdBulbNormal/__shdBulbNormal.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbNormal", + "type": 1, + "parent": { + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbNormalUp/__shdBulbNormalUp.fsh b/shaders/__shdBulbNormalUp/__shdBulbNormalUp.fsh new file mode 100644 index 0000000..0629d75 --- /dev/null +++ b/shaders/__shdBulbNormalUp/__shdBulbNormalUp.fsh @@ -0,0 +1,11 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fAlphaThreshold; + +void main() +{ + gl_FragColor = texture2D(gm_BaseTexture, v_vTexcoord); + if (gl_FragColor.a < u_fAlphaThreshold) discard; + gl_FragColor = vec4(0.5, 0.5, 1.0, 1.0); +} \ No newline at end of file diff --git a/shaders/__shdBulbNormalUp/__shdBulbNormalUp.vsh b/shaders/__shdBulbNormalUp/__shdBulbNormalUp.vsh new file mode 100644 index 0000000..c0500b7 --- /dev/null +++ b/shaders/__shdBulbNormalUp/__shdBulbNormalUp.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/__shdBulbNormalUp/__shdBulbNormalUp.yy b/shaders/__shdBulbNormalUp/__shdBulbNormalUp.yy new file mode 100644 index 0000000..e391caf --- /dev/null +++ b/shaders/__shdBulbNormalUp/__shdBulbNormalUp.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbNormalUp", + "type": 1, + "parent": { + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.vsh b/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.vsh index 7efd1f3..dda93cb 100644 --- a/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.vsh +++ b/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.vsh @@ -1,6 +1,6 @@ precision highp float; -#define MAX_LENGTH 50.0 +#define MAX_LENGTH 500.0 attribute vec3 in_Position; attribute vec3 in_Normal; diff --git a/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy b/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy index 6d0f54e..0ce1304 100644 --- a/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy +++ b/shaders/__shdBulbSoftShadows/__shdBulbSoftShadows.yy @@ -4,7 +4,7 @@ "name": "__shdBulbSoftShadows", "type": 1, "parent": { - "name": "(Pay no attention to that man behind the curtain)", - "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", + "name": "Shadow", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Shadow.yy", }, } \ No newline at end of file diff --git a/shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy b/shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy index 6d91d7b..0563ae0 100644 --- a/shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy +++ b/shaders/__shdBulbSoftShadowsSunlight/__shdBulbSoftShadowsSunlight.yy @@ -4,7 +4,7 @@ "name": "__shdBulbSoftShadowsSunlight", "type": 1, "parent": { - "name": "(Pay no attention to that man behind the curtain)", - "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain).yy", + "name": "Shadow", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Shadow.yy", }, } \ No newline at end of file diff --git a/shaders/__shdBulbSpecular/__shdBulbSpecular.fsh b/shaders/__shdBulbSpecular/__shdBulbSpecular.fsh new file mode 100644 index 0000000..1ef8606 --- /dev/null +++ b/shaders/__shdBulbSpecular/__shdBulbSpecular.fsh @@ -0,0 +1,11 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fAlphaThreshold; + +void main() +{ + gl_FragColor = texture2D(gm_BaseTexture, v_vTexcoord); + if (gl_FragColor.a < u_fAlphaThreshold) discard; + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0 - v_vColour.a*texture2D(gm_BaseTexture, v_vTexcoord).a); +} \ No newline at end of file diff --git a/shaders/__shdBulbSpecular/__shdBulbSpecular.vsh b/shaders/__shdBulbSpecular/__shdBulbSpecular.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbSpecular/__shdBulbSpecular.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbSpecular/__shdBulbSpecular.yy b/shaders/__shdBulbSpecular/__shdBulbSpecular.yy new file mode 100644 index 0000000..b8e23ab --- /dev/null +++ b/shaders/__shdBulbSpecular/__shdBulbSpecular.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbSpecular", + "type": 1, + "parent": { + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.fsh b/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.fsh new file mode 100644 index 0000000..10c87f6 --- /dev/null +++ b/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.fsh @@ -0,0 +1,11 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fAlphaThreshold; + +void main() +{ + gl_FragColor = texture2D(gm_BaseTexture, v_vTexcoord); + if (gl_FragColor.a < u_fAlphaThreshold) discard; + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0 - v_vColour.a); +} \ No newline at end of file diff --git a/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.vsh b/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.yy b/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.yy new file mode 100644 index 0000000..fae9ee8 --- /dev/null +++ b/shaders/__shdBulbSpecularForce/__shdBulbSpecularForce.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbSpecularForce", + "type": 1, + "parent": { + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.fsh b/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.fsh new file mode 100644 index 0000000..c66fd4b --- /dev/null +++ b/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.fsh @@ -0,0 +1,24 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; +varying vec2 v_vPosition; + +uniform sampler2D u_sNormalMap; +uniform vec4 u_vInfo; +uniform vec4 u_vCamera; +uniform float u_fSpecularIntensity; + +void main() +{ + #ifdef _YY_HLSL11_ + vec2 objectPos = v_vPosition*vec2(1.0, -1.0); + #else + vec2 objectPos = v_vPosition; + #endif + + vec3 lightPos = vec3((u_vInfo.xy - u_vCamera.xy) / u_vCamera.zw, u_vInfo.z); + + vec4 normalSpecular = texture2D(u_sNormalMap, 0.5 + 0.5*objectPos); + + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb *= u_vInfo.w*((u_fSpecularIntensity*(1.0 - normalSpecular.w) + 1.0)*max(0.0, dot(vec3(-u_vInfo.xy, u_vInfo.z), 2.0*normalSpecular.xyz - 1.0))); +} \ No newline at end of file diff --git a/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.vsh b/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.vsh new file mode 100644 index 0000000..daa3ccd --- /dev/null +++ b/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.vsh @@ -0,0 +1,15 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; +varying vec2 v_vPosition; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; + v_vPosition = gl_Position.xy; +} \ No newline at end of file diff --git a/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.yy b/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.yy new file mode 100644 index 0000000..1b4c982 --- /dev/null +++ b/shaders/__shdBulbSunlightWithNormalMap/__shdBulbSunlightWithNormalMap.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbSunlightWithNormalMap", + "type": 1, + "parent": { + "name": "Light", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Light.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.fsh b/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.fsh new file mode 100644 index 0000000..6e36c46 --- /dev/null +++ b/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.fsh @@ -0,0 +1,10 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fIntensity; + +void main() +{ + gl_FragColor = v_vColour * texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb *= u_fIntensity; +} \ No newline at end of file diff --git a/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.vsh b/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.vsh new file mode 100644 index 0000000..cb82510 --- /dev/null +++ b/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.yy b/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.yy new file mode 100644 index 0000000..62d2d82 --- /dev/null +++ b/shaders/__shdBulbSunlightWithoutNormalMap/__shdBulbSunlightWithoutNormalMap.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbSunlightWithoutNormalMap", + "type": 1, + "parent": { + "name": "Light", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Light.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbThreshold/__shdBulbThreshold.fsh b/shaders/__shdBulbThreshold/__shdBulbThreshold.fsh new file mode 100644 index 0000000..1f08c7a --- /dev/null +++ b/shaders/__shdBulbThreshold/__shdBulbThreshold.fsh @@ -0,0 +1,15 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 u_vThreshold; + +float Luminance(vec3 color) +{ + return dot(color, vec3(0.2126, 0.7152, 0.0722)); +} + +void main() +{ + gl_FragColor = v_vColour * texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb *= smoothstep(u_vThreshold.x, u_vThreshold.y, Luminance(gl_FragColor.rgb)); +} \ No newline at end of file diff --git a/shaders/__shdBulbPassThrough/__shdBulbPassThrough.vsh b/shaders/__shdBulbThreshold/__shdBulbThreshold.vsh similarity index 100% rename from shaders/__shdBulbPassThrough/__shdBulbPassThrough.vsh rename to shaders/__shdBulbThreshold/__shdBulbThreshold.vsh diff --git a/shaders/__shdBulbThreshold/__shdBulbThreshold.yy b/shaders/__shdBulbThreshold/__shdBulbThreshold.yy new file mode 100644 index 0000000..6fa3d68 --- /dev/null +++ b/shaders/__shdBulbThreshold/__shdBulbThreshold.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbThreshold", + "type": 1, + "parent": { + "name": "Shaders", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.fsh b/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.fsh new file mode 100644 index 0000000..e48c359 --- /dev/null +++ b/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.fsh @@ -0,0 +1,28 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +vec3 ACES(vec3 color) +{ + // Narkowicz 2015, "ACES Filmic Tone Mapping Curve" + const float a = 2.51; + const float b = 0.03; + const float c = 2.43; + const float d = 0.59; + const float e = 0.14; + return (color * (a * color + b)) / (color * (c * color + d) + e); +} + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = pow(ACES(u_fExposure*gl_FragColor.rgb*light.rgb), vec3(1.0/gamma)); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.vsh b/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.yy b/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.yy new file mode 100644 index 0000000..b80c968 --- /dev/null +++ b/shaders/__shdBulbTonemapACES/__shdBulbTonemapACES.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapACES", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.fsh b/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.fsh new file mode 100644 index 0000000..014b540 --- /dev/null +++ b/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.fsh @@ -0,0 +1,14 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = clamp(u_fExposure*gl_FragColor.rgb*light.rgb, 0.0, 1.0); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.vsh b/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.yy b/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.yy new file mode 100644 index 0000000..38c1b18 --- /dev/null +++ b/shaders/__shdBulbTonemapBadGamma/__shdBulbTonemapBadGamma.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapBadGamma", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.fsh b/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.fsh new file mode 100644 index 0000000..a7fb5c9 --- /dev/null +++ b/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.fsh @@ -0,0 +1,17 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = clamp(pow(u_fExposure*gl_FragColor.rgb*light.rgb, vec3(1.0/gamma)), 0.0, 1.0); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.vsh b/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.yy b/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.yy new file mode 100644 index 0000000..eda0eaf --- /dev/null +++ b/shaders/__shdBulbTonemapClamp/__shdBulbTonemapClamp.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapClamp", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.fsh b/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.fsh new file mode 100644 index 0000000..5639cce --- /dev/null +++ b/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.fsh @@ -0,0 +1,23 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +vec3 Heji_BurgessDawson(vec3 color) +{ + color = max(vec3(0.0), color - 0.004); + return (color * (6.2*color + 0.5)) / (color * (6.2*color + 1.7) + 0.06); +} + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = Heji_BurgessDawson(u_fExposure*gl_FragColor.rgb*light.rgb); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.vsh b/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.yy b/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.yy new file mode 100644 index 0000000..05b80d2 --- /dev/null +++ b/shaders/__shdBulbTonemapHBD/__shdBulbTonemapHBD.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapHBD", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.fsh b/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.fsh new file mode 100644 index 0000000..39637f8 --- /dev/null +++ b/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.fsh @@ -0,0 +1,17 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = pow(u_fExposure*gl_FragColor.rgb*light.rgb, vec3(1.0/gamma)); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.vsh b/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.yy b/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.yy new file mode 100644 index 0000000..5c6473f --- /dev/null +++ b/shaders/__shdBulbTonemapNone/__shdBulbTonemapNone.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapNone", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.fsh b/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.fsh new file mode 100644 index 0000000..af7f82d --- /dev/null +++ b/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.fsh @@ -0,0 +1,34 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +float Luminance(vec3 color) +{ + return dot(color, vec3(0.2126, 0.7152, 0.0722)); +} + +vec3 ChangeLuminance(vec3 color, float targetLuminance) +{ + return color * (targetLuminance / Luminance(color)); +} + +vec3 Reinhard(vec3 color) +{ + float luminance = Luminance(color); + float luminanceNew = luminance / (1.0 + luminance); + return ChangeLuminance(color, luminanceNew); +} + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = pow(Reinhard(u_fExposure*gl_FragColor.rgb*light.rgb), vec3(1.0/gamma)); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.vsh b/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.yy b/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.yy new file mode 100644 index 0000000..79e5163 --- /dev/null +++ b/shaders/__shdBulbTonemapReinhard/__shdBulbTonemapReinhard.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapReinhard", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.fsh b/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.fsh new file mode 100644 index 0000000..55bbd69 --- /dev/null +++ b/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.fsh @@ -0,0 +1,35 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +float Luminance(vec3 color) +{ + return dot(color, vec3(0.2126, 0.7152, 0.0722)); +} + +vec3 ChangeLuminance(vec3 color, float targetLuminance) +{ + return color * (targetLuminance / Luminance(color)); +} + +vec3 ReinhardExtended(vec3 color, float whitepoint) +{ + float luminance = Luminance(color); + float numerator = luminance * (1.0 + (luminance / (whitepoint * whitepoint))); + float luminanceNew = numerator / (1.0 + luminance); + return ChangeLuminance(color, luminanceNew); +} + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = pow(ReinhardExtended(u_fExposure*gl_FragColor.rgb*light.rgb, 4.0), vec3(1.0/gamma)); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.vsh b/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.yy b/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.yy new file mode 100644 index 0000000..d4d64db --- /dev/null +++ b/shaders/__shdBulbTonemapReinhardExtended/__shdBulbTonemapReinhardExtended.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapReinhardExtended", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.fsh b/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.fsh new file mode 100644 index 0000000..3ba5ca9 --- /dev/null +++ b/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.fsh @@ -0,0 +1,29 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +vec3 Uncharted2(vec3 color) +{ + float A = 0.15; + float B = 0.50; + float C = 0.10; + float D = 0.20; + float E = 0.02; + float F = 0.30; + + return ((color*(A*color+C*B)+D*E)/(color*(A*color+B)+D*F))-E/F; +} + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = pow(Uncharted2(u_fExposure*4.0*gl_FragColor.rgb*light.rgb), vec3(1.0/gamma)); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.vsh b/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.yy b/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.yy new file mode 100644 index 0000000..0c86188 --- /dev/null +++ b/shaders/__shdBulbTonemapUncharted2/__shdBulbTonemapUncharted2.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapUncharted2", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.fsh b/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.fsh new file mode 100644 index 0000000..72dff43 --- /dev/null +++ b/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.fsh @@ -0,0 +1,22 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform float u_fExposure; +uniform sampler2D u_sLightMap; + +const float gamma = 2.2; + +vec3 Unreal3(vec3 color) +{ + return color / (color + 0.155) * 1.019; +} + +void main() +{ + gl_FragColor = v_vColour*texture2D(gm_BaseTexture, v_vTexcoord); + gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(gamma)); + + vec4 light = texture2D(u_sLightMap, v_vTexcoord); + + gl_FragColor.rgb = Unreal3(u_fExposure*gl_FragColor.rgb*light.rgb); +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.vsh b/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.vsh new file mode 100644 index 0000000..a73ace9 --- /dev/null +++ b/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.vsh @@ -0,0 +1,13 @@ +attribute vec3 in_Position; +attribute vec4 in_Colour; +attribute vec2 in_TextureCoord; + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION]*vec4(in_Position.xyz, 1.0); + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} \ No newline at end of file diff --git a/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.yy b/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.yy new file mode 100644 index 0000000..daf36b4 --- /dev/null +++ b/shaders/__shdBulbTonemapUnreal3/__shdBulbTonemapUnreal3.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "__shdBulbTonemapUnreal3", + "type": 1, + "parent": { + "name": "Tonemapping", + "path": "folders/Bulb/(System)/(Pay no attention to that man behind the curtain)/Shaders/Tonemapping.yy", + }, +} \ No newline at end of file diff --git a/shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy b/shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy index 67e6321..db447ab 100644 --- a/shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy +++ b/shaders/shdPremultiplyAlpha/shdPremultiplyAlpha.yy @@ -1,11 +1,10 @@ { + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "shdPremultiplyAlpha", "type": 1, "parent": { "name": "Example", "path": "folders/Example.yy", }, - "resourceVersion": "1.0", - "name": "shdPremultiplyAlpha", - "tags": [], - "resourceType": "GMShader", } \ No newline at end of file diff --git a/sprites/sEmissive/d20b0601-833e-45a9-9721-dac981780359.png b/sprites/sEmissive/d20b0601-833e-45a9-9721-dac981780359.png new file mode 100644 index 0000000..7323854 Binary files /dev/null and b/sprites/sEmissive/d20b0601-833e-45a9-9721-dac981780359.png differ diff --git a/sprites/sEmissive/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png b/sprites/sEmissive/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png new file mode 100644 index 0000000..7323854 Binary files /dev/null and b/sprites/sEmissive/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png differ diff --git a/sprites/sEmissive/sEmissive.yy b/sprites/sEmissive/sEmissive.yy new file mode 100644 index 0000000..0e1e846 --- /dev/null +++ b/sprites/sEmissive/sEmissive.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "sEmissive", + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 4, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 0.5, + "bbox_left": 0, + "bbox_right": 127, + "bbox_top": 0, + "bbox_bottom": 127, + "HTile": false, + "VTile": false, + "For3D": false, + "DynamicTexturePage": false, + "width": 128, + "height": 128, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d20b0601-833e-45a9-9721-dac981780359",}, + ], + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "sEmissive", + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"41992403-f0f9-4118-a086-46af2ed567e6","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"d20b0601-833e-45a9-9721-dac981780359","path":"sprites/sEmissive/sEmissive.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 64, + "yorigin": 64, + "eventToFunction": {}, + "eventStubScript": null, + }, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"af9b6b16-b1e9-407b-9bc3-e262c9bdd065","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Example/Sprites.yy", + }, +} \ No newline at end of file diff --git a/sprites/sFloorNormal/3d3b97df-556b-4ae9-b833-c01d03b1a88c.png b/sprites/sFloorNormal/3d3b97df-556b-4ae9-b833-c01d03b1a88c.png new file mode 100644 index 0000000..10dd059 Binary files /dev/null and b/sprites/sFloorNormal/3d3b97df-556b-4ae9-b833-c01d03b1a88c.png differ diff --git a/sprites/sFloorNormal/layers/3d3b97df-556b-4ae9-b833-c01d03b1a88c/cc653193-6b92-427b-be90-6188eaef2bc7.png b/sprites/sFloorNormal/layers/3d3b97df-556b-4ae9-b833-c01d03b1a88c/cc653193-6b92-427b-be90-6188eaef2bc7.png new file mode 100644 index 0000000..10dd059 Binary files /dev/null and b/sprites/sFloorNormal/layers/3d3b97df-556b-4ae9-b833-c01d03b1a88c/cc653193-6b92-427b-be90-6188eaef2bc7.png differ diff --git a/sprites/sFloorNormal/sFloorNormal.yy b/sprites/sFloorNormal/sFloorNormal.yy new file mode 100644 index 0000000..2568aab --- /dev/null +++ b/sprites/sFloorNormal/sFloorNormal.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "sFloorNormal", + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 0.5, + "bbox_left": 0, + "bbox_right": 255, + "bbox_top": 0, + "bbox_bottom": 255, + "HTile": false, + "VTile": false, + "For3D": false, + "DynamicTexturePage": false, + "width": 256, + "height": 256, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"3d3b97df-556b-4ae9-b833-c01d03b1a88c",}, + ], + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "sFloorNormal", + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"f7502592-254a-4287-a9eb-ccca79303cca","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"3d3b97df-556b-4ae9-b833-c01d03b1a88c","path":"sprites/sFloorNormal/sFloorNormal.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + }, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"cc653193-6b92-427b-be90-6188eaef2bc7","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Example/Sprites.yy", + }, +} \ No newline at end of file diff --git a/sprites/sFloorTexture/31479f43-7cc3-4c20-b1bb-e72b6d1a5856.png b/sprites/sFloorTexture/31479f43-7cc3-4c20-b1bb-e72b6d1a5856.png new file mode 100644 index 0000000..09b6a2a Binary files /dev/null and b/sprites/sFloorTexture/31479f43-7cc3-4c20-b1bb-e72b6d1a5856.png differ diff --git a/sprites/sFloorTexture/layers/31479f43-7cc3-4c20-b1bb-e72b6d1a5856/bd5b997d-1abf-4c38-9979-0885413953d0.png b/sprites/sFloorTexture/layers/31479f43-7cc3-4c20-b1bb-e72b6d1a5856/bd5b997d-1abf-4c38-9979-0885413953d0.png new file mode 100644 index 0000000..09b6a2a Binary files /dev/null and b/sprites/sFloorTexture/layers/31479f43-7cc3-4c20-b1bb-e72b6d1a5856/bd5b997d-1abf-4c38-9979-0885413953d0.png differ diff --git a/sprites/sFloorTexture/sFloorTexture.yy b/sprites/sFloorTexture/sFloorTexture.yy new file mode 100644 index 0000000..5ccb0bd --- /dev/null +++ b/sprites/sFloorTexture/sFloorTexture.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "sFloorTexture", + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 0, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 0.5, + "bbox_left": 0, + "bbox_right": 255, + "bbox_top": 0, + "bbox_bottom": 255, + "HTile": false, + "VTile": false, + "For3D": false, + "DynamicTexturePage": false, + "width": 256, + "height": 256, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"31479f43-7cc3-4c20-b1bb-e72b6d1a5856",}, + ], + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "sFloorTexture", + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"21b6a877-ca7b-4a8e-aaf6-b03fc94d008c","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"31479f43-7cc3-4c20-b1bb-e72b6d1a5856","path":"sprites/sFloorTexture/sFloorTexture.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 0, + "yorigin": 0, + "eventToFunction": {}, + "eventStubScript": null, + }, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"bd5b997d-1abf-4c38-9979-0885413953d0","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Example/Sprites.yy", + }, +} \ No newline at end of file diff --git a/sprites/sLight128/0b4fa85a-2f12-4543-97a1-5b794675e11e.png b/sprites/sLight128/0b4fa85a-2f12-4543-97a1-5b794675e11e.png new file mode 100644 index 0000000..0694fcc Binary files /dev/null and b/sprites/sLight128/0b4fa85a-2f12-4543-97a1-5b794675e11e.png differ diff --git a/sprites/sLight128/6dd55a03-e2af-42c5-b23f-c5a390f4b48a.png b/sprites/sLight128/6dd55a03-e2af-42c5-b23f-c5a390f4b48a.png deleted file mode 100644 index fbc43cb..0000000 Binary files a/sprites/sLight128/6dd55a03-e2af-42c5-b23f-c5a390f4b48a.png and /dev/null differ diff --git a/sprites/sLight128/layers/0b4fa85a-2f12-4543-97a1-5b794675e11e/b9f9c6cd-9914-4326-90c3-9ecd4ecf63c6.png b/sprites/sLight128/layers/0b4fa85a-2f12-4543-97a1-5b794675e11e/b9f9c6cd-9914-4326-90c3-9ecd4ecf63c6.png new file mode 100644 index 0000000..0694fcc Binary files /dev/null and b/sprites/sLight128/layers/0b4fa85a-2f12-4543-97a1-5b794675e11e/b9f9c6cd-9914-4326-90c3-9ecd4ecf63c6.png differ diff --git a/sprites/sLight128/layers/6dd55a03-e2af-42c5-b23f-c5a390f4b48a/8368baff-b33a-45bd-9ee1-087490ab8740.png b/sprites/sLight128/layers/6dd55a03-e2af-42c5-b23f-c5a390f4b48a/8368baff-b33a-45bd-9ee1-087490ab8740.png deleted file mode 100644 index fbc43cb..0000000 Binary files a/sprites/sLight128/layers/6dd55a03-e2af-42c5-b23f-c5a390f4b48a/8368baff-b33a-45bd-9ee1-087490ab8740.png and /dev/null differ diff --git a/sprites/sLight128/sLight128.yy b/sprites/sLight128/sLight128.yy index e36b235..28116c7 100644 --- a/sprites/sLight128/sLight128.yy +++ b/sprites/sLight128/sLight128.yy @@ -10,10 +10,10 @@ "edgeFiltering": false, "collisionTolerance": 0, "swfPrecision": 2.525, - "bbox_left": 0, - "bbox_right": 127, - "bbox_top": 0, - "bbox_bottom": 127, + "bbox_left": 1, + "bbox_right": 126, + "bbox_top": 1, + "bbox_bottom": 126, "HTile": false, "VTile": false, "For3D": false, @@ -28,7 +28,7 @@ "gridX": 0, "gridY": 0, "frames": [ - {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"6dd55a03-e2af-42c5-b23f-c5a390f4b48a",}, + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"0b4fa85a-2f12-4543-97a1-5b794675e11e",}, ], "sequence": { "resourceType": "GMSequence", @@ -45,7 +45,7 @@ "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, "tracks": [ {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ - {"id":"54357903-4c17-4be7-94d7-6972a18fcfba","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"6dd55a03-e2af-42c5-b23f-c5a390f4b48a","path":"sprites/sLight128/sLight128.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + {"id":"b963c74b-b5ac-4860-ab0a-703c0ea1f13f","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"0b4fa85a-2f12-4543-97a1-5b794675e11e","path":"sprites/sLight128/sLight128.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, ], "visibleRange": null, @@ -64,7 +64,7 @@ "eventStubScript": null, }, "layers": [ - {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"8368baff-b33a-45bd-9ee1-087490ab8740","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"b9f9c6cd-9914-4326-90c3-9ecd4ecf63c6","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, ], "nineSlice": null, "parent": { diff --git a/sprites/sPyramid/d20b0601-833e-45a9-9721-dac981780359.png b/sprites/sPyramid/d20b0601-833e-45a9-9721-dac981780359.png new file mode 100644 index 0000000..1233088 Binary files /dev/null and b/sprites/sPyramid/d20b0601-833e-45a9-9721-dac981780359.png differ diff --git a/sprites/sPyramid/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png b/sprites/sPyramid/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png new file mode 100644 index 0000000..1233088 Binary files /dev/null and b/sprites/sPyramid/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png differ diff --git a/sprites/sPyramid/sPyramid.yy b/sprites/sPyramid/sPyramid.yy new file mode 100644 index 0000000..4673adc --- /dev/null +++ b/sprites/sPyramid/sPyramid.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "sPyramid", + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 4, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 0.5, + "bbox_left": 0, + "bbox_right": 127, + "bbox_top": 0, + "bbox_bottom": 127, + "HTile": false, + "VTile": false, + "For3D": false, + "DynamicTexturePage": false, + "width": 128, + "height": 128, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d20b0601-833e-45a9-9721-dac981780359",}, + ], + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "sPyramid", + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"41992403-f0f9-4118-a086-46af2ed567e6","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"d20b0601-833e-45a9-9721-dac981780359","path":"sprites/sPyramid/sPyramid.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 64, + "yorigin": 64, + "eventToFunction": {}, + "eventStubScript": null, + }, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"af9b6b16-b1e9-407b-9bc3-e262c9bdd065","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Example/Sprites.yy", + }, +} \ No newline at end of file diff --git a/sprites/sPyramidNormal/d20b0601-833e-45a9-9721-dac981780359.png b/sprites/sPyramidNormal/d20b0601-833e-45a9-9721-dac981780359.png new file mode 100644 index 0000000..203a687 Binary files /dev/null and b/sprites/sPyramidNormal/d20b0601-833e-45a9-9721-dac981780359.png differ diff --git a/sprites/sPyramidNormal/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png b/sprites/sPyramidNormal/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png new file mode 100644 index 0000000..203a687 Binary files /dev/null and b/sprites/sPyramidNormal/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png differ diff --git a/sprites/sPyramidNormal/sPyramidNormal.yy b/sprites/sPyramidNormal/sPyramidNormal.yy new file mode 100644 index 0000000..47916e4 --- /dev/null +++ b/sprites/sPyramidNormal/sPyramidNormal.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "sPyramidNormal", + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 4, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 0.5, + "bbox_left": 0, + "bbox_right": 127, + "bbox_top": 0, + "bbox_bottom": 127, + "HTile": false, + "VTile": false, + "For3D": false, + "DynamicTexturePage": false, + "width": 128, + "height": 128, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d20b0601-833e-45a9-9721-dac981780359",}, + ], + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "sPyramidNormal", + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"41992403-f0f9-4118-a086-46af2ed567e6","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"d20b0601-833e-45a9-9721-dac981780359","path":"sprites/sPyramidNormal/sPyramidNormal.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 64, + "yorigin": 64, + "eventToFunction": {}, + "eventStubScript": null, + }, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"af9b6b16-b1e9-407b-9bc3-e262c9bdd065","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Example/Sprites.yy", + }, +} \ No newline at end of file diff --git a/sprites/sPyramidSpecular/d20b0601-833e-45a9-9721-dac981780359.png b/sprites/sPyramidSpecular/d20b0601-833e-45a9-9721-dac981780359.png new file mode 100644 index 0000000..2b98cb0 Binary files /dev/null and b/sprites/sPyramidSpecular/d20b0601-833e-45a9-9721-dac981780359.png differ diff --git a/sprites/sPyramidSpecular/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png b/sprites/sPyramidSpecular/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png new file mode 100644 index 0000000..2b98cb0 Binary files /dev/null and b/sprites/sPyramidSpecular/layers/d20b0601-833e-45a9-9721-dac981780359/af9b6b16-b1e9-407b-9bc3-e262c9bdd065.png differ diff --git a/sprites/sPyramidSpecular/sPyramidSpecular.yy b/sprites/sPyramidSpecular/sPyramidSpecular.yy new file mode 100644 index 0000000..4064fa3 --- /dev/null +++ b/sprites/sPyramidSpecular/sPyramidSpecular.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "sPyramidSpecular", + "bboxMode": 0, + "collisionKind": 1, + "type": 0, + "origin": 4, + "preMultiplyAlpha": false, + "edgeFiltering": false, + "collisionTolerance": 0, + "swfPrecision": 0.5, + "bbox_left": 0, + "bbox_right": 127, + "bbox_top": 0, + "bbox_bottom": 127, + "HTile": false, + "VTile": false, + "For3D": false, + "DynamicTexturePage": false, + "width": 128, + "height": 128, + "textureGroupId": { + "name": "Default", + "path": "texturegroups/Default", + }, + "swatchColours": null, + "gridX": 0, + "gridY": 0, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d20b0601-833e-45a9-9721-dac981780359",}, + ], + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "sPyramidSpecular", + "timeUnits": 1, + "playback": 1, + "playbackSpeed": 30.0, + "playbackSpeedType": 0, + "autoRecord": true, + "volume": 1.0, + "length": 1.0, + "events": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"e74e23a0-f83a-4f35-ad2c-38ec843398b6","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"d20b0601-833e-45a9-9721-dac981780359","path":"sprites/sPyramidSpecular/sPyramidSpecular.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"isCreationTrack":false,"modifiers":[],}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 64, + "yorigin": 64, + "eventToFunction": {}, + "eventStubScript": null, + }, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"af9b6b16-b1e9-407b-9bc3-e262c9bdd065","visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default",}, + ], + "nineSlice": null, + "parent": { + "name": "Sprites", + "path": "folders/Example/Sprites.yy", + }, +} \ No newline at end of file diff --git a/sprites/sStaticBlock/b6894136-19e2-4a78-b6a5-ef2aa6693a7e.png b/sprites/sStaticBlock/b6894136-19e2-4a78-b6a5-ef2aa6693a7e.png index d13cee2..d37c6af 100644 Binary files a/sprites/sStaticBlock/b6894136-19e2-4a78-b6a5-ef2aa6693a7e.png and b/sprites/sStaticBlock/b6894136-19e2-4a78-b6a5-ef2aa6693a7e.png differ diff --git a/sprites/sStaticBlock/layers/b6894136-19e2-4a78-b6a5-ef2aa6693a7e/9d73427e-a052-4c73-aecc-ae7d10ffe648.png b/sprites/sStaticBlock/layers/b6894136-19e2-4a78-b6a5-ef2aa6693a7e/9d73427e-a052-4c73-aecc-ae7d10ffe648.png index d13cee2..d37c6af 100644 Binary files a/sprites/sStaticBlock/layers/b6894136-19e2-4a78-b6a5-ef2aa6693a7e/9d73427e-a052-4c73-aecc-ae7d10ffe648.png and b/sprites/sStaticBlock/layers/b6894136-19e2-4a78-b6a5-ef2aa6693a7e/9d73427e-a052-4c73-aecc-ae7d10ffe648.png differ