Skip to content

Commit

Permalink
Added 3.19.0 source
Browse files Browse the repository at this point in the history
  • Loading branch information
kraifpatrik committed Aug 11, 2023
1 parent 33324b1 commit 05249af
Show file tree
Hide file tree
Showing 74 changed files with 738 additions and 307 deletions.
10 changes: 6 additions & 4 deletions BBMOD_GML/BBMOD.resource_order
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
{"name":"BBMOD_ImageBasedLight","order":3,"path":"scripts/BBMOD_ImageBasedLight/BBMOD_ImageBasedLight.yy",},
{"name":"DrawTextShadow","order":2,"path":"scripts/DrawTextShadow/DrawTextShadow.yy",},
{"name":"__bbmod_light_ambient","order":5,"path":"scripts/__bbmod_light_ambient/__bbmod_light_ambient.yy",},
{"name":"BBMOD_TerrainMaterial","order":7,"path":"scripts/BBMOD_TerrainMaterial/BBMOD_TerrainMaterial.yy",},
{"name":"BBMOD_SetQuaternionModule","order":2,"path":"scripts/BBMOD_SetQuaternionModule/BBMOD_SetQuaternionModule.yy",},
{"name":"BBMOD_ShDefaultUnlitColor","order":13,"path":"shaders/BBMOD_ShDefaultUnlitColor/BBMOD_ShDefaultUnlitColor.yy",},
{"name":"SndShell2","order":2,"path":"sounds/SndShell2/SndShell2.yy",},
Expand All @@ -116,7 +117,6 @@
{"name":"BBMOD_ShInstanceIDAnimated","order":1,"path":"shaders/BBMOD_ShInstanceIDAnimated/BBMOD_ShInstanceIDAnimated.yy",},
{"name":"BBMOD_VertexFormat","order":4,"path":"scripts/BBMOD_VertexFormat/BBMOD_VertexFormat.yy",},
{"name":"BBMOD_LightmapShader","order":1,"path":"scripts/BBMOD_LightmapShader/BBMOD_LightmapShader.yy",},
{"name":"SprSand","order":1,"path":"sprites/SprSand/SprSand.yy",},
{"name":"BBMOD_IRenderable","order":1,"path":"scripts/BBMOD_IRenderable/BBMOD_IRenderable.yy",},
{"name":"BBMOD_MixQuaternionFromSpeedModule","order":1,"path":"scripts/BBMOD_MixQuaternionFromSpeedModule/BBMOD_MixQuaternionFromSpeedModule.yy",},
{"name":"BBMOD_MixVec2OverTimeModule","order":3,"path":"scripts/BBMOD_MixVec2OverTimeModule/BBMOD_MixVec2OverTimeModule.yy",},
Expand Down Expand Up @@ -148,7 +148,7 @@
{"name":"OItem","order":1,"path":"objects/OItem/OItem.yy",},
{"name":"SndWhoosh","order":5,"path":"sounds/SndWhoosh/SndWhoosh.yy",},
{"name":"BBMOD_AddVec2OverTimeModule","order":3,"path":"scripts/BBMOD_AddVec2OverTimeModule/BBMOD_AddVec2OverTimeModule.yy",},
{"name":"SprSplatmap","order":5,"path":"sprites/SprSplatmap/SprSplatmap.yy",},
{"name":"SprSplatmap","order":3,"path":"sprites/SprSplatmap/SprSplatmap.yy",},
{"name":"__bbmod_d3d11","order":9,"path":"scripts/__bbmod_d3d11/__bbmod_d3d11.yy",},
{"name":"BBMOD_MixVec2FromHealthModule","order":2,"path":"scripts/BBMOD_MixVec2FromHealthModule/BBMOD_MixVec2FromHealthModule.yy",},
{"name":"__BBMOD_ShCheckMRT","order":11,"path":"shaders/__BBMOD_ShCheckMRT/__BBMOD_ShCheckMRT.yy",},
Expand Down Expand Up @@ -185,6 +185,7 @@
{"name":"BBMOD_ShTerrain","order":3,"path":"shaders/BBMOD_ShTerrain/BBMOD_ShTerrain.yy",},
{"name":"BBMOD_ShDefaultColorAnimated","order":18,"path":"shaders/BBMOD_ShDefaultColorAnimated/BBMOD_ShDefaultColorAnimated.yy",},
{"name":"ShZombieDepth","order":1,"path":"shaders/ShZombieDepth/ShZombieDepth.yy",},
{"name":"BBMOD_TerrainLayer","order":5,"path":"scripts/BBMOD_TerrainLayer/BBMOD_TerrainLayer.yy",},
{"name":"__BBMOD_ShPrefilterSpecular","order":16,"path":"shaders/__BBMOD_ShPrefilterSpecular/__BBMOD_ShPrefilterSpecular.yy",},
{"name":"BBMOD_SpotLight","order":4,"path":"scripts/BBMOD_SpotLight/BBMOD_SpotLight.yy",},
{"name":"BBMOD_DefaultLightmapMaterial","order":6,"path":"scripts/BBMOD_DefaultLightmapMaterial/BBMOD_DefaultLightmapMaterial.yy",},
Expand All @@ -204,6 +205,7 @@
{"name":"BBMOD_SprColorGradingLUT","order":1,"path":"sprites/BBMOD_SprColorGradingLUT/BBMOD_SprColorGradingLUT.yy",},
{"name":"__bbmod_string","order":6,"path":"scripts/__bbmod_string/__bbmod_string.yy",},
{"name":"BBMOD_Node","order":2,"path":"scripts/BBMOD_Node/BBMOD_Node.yy",},
{"name":"BBMOD_TerrainShader","order":6,"path":"scripts/BBMOD_TerrainShader/BBMOD_TerrainShader.yy",},
{"name":"BBMOD_MixSpeedModule","order":1,"path":"scripts/BBMOD_MixSpeedModule/BBMOD_MixSpeedModule.yy",},
{"name":"BBMOD_Matrix","order":6,"path":"scripts/BBMOD_Matrix/BBMOD_Matrix.yy",},
{"name":"BBMOD_SprBlack","order":14,"path":"sprites/BBMOD_SprBlack/BBMOD_SprBlack.yy",},
Expand All @@ -212,7 +214,7 @@
{"name":"BBMOD_AddVec4OverTimeModule","order":1,"path":"scripts/BBMOD_AddVec4OverTimeModule/BBMOD_AddVec4OverTimeModule.yy",},
{"name":"BBMOD_Vec4","order":4,"path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},
{"name":"SndFootstep1","order":1,"path":"sounds/SndFootstep1/SndFootstep1.yy",},
{"name":"SprHeightmap","order":4,"path":"sprites/SprHeightmap/SprHeightmap.yy",},
{"name":"SprHeightmap","order":2,"path":"sprites/SprHeightmap/SprHeightmap.yy",},
{"name":"BBMOD_ShGizmoSelect","order":5,"path":"shaders/BBMOD_ShGizmoSelect/BBMOD_ShGizmoSelect.yy",},
{"name":"BBMOD_MixVec3FromHealthModule","order":3,"path":"scripts/BBMOD_MixVec3FromHealthModule/BBMOD_MixVec3FromHealthModule.yy",},
{"name":"BBMOD_ShDefaultDepth","order":7,"path":"shaders/BBMOD_ShDefaultDepth/BBMOD_ShDefaultDepth.yy",},
Expand Down Expand Up @@ -265,7 +267,7 @@
{"name":"bbmod_cmp","order":1,"path":"scripts/bbmod_cmp/bbmod_cmp.yy",},
{"name":"Fnt48","order":2,"path":"fonts/Fnt48/Fnt48.yy",},
{"name":"BBMOD_ShTerrainUnlit","order":4,"path":"shaders/BBMOD_ShTerrainUnlit/BBMOD_ShTerrainUnlit.yy",},
{"name":"SprDirt","order":2,"path":"sprites/SprDirt/SprDirt.yy",},
{"name":"SprDirt","order":1,"path":"sprites/SprDirt/SprDirt.yy",},
{"name":"BBMOD_ShDefaultUnlitColorBatched","order":14,"path":"shaders/BBMOD_ShDefaultUnlitColorBatched/BBMOD_ShDefaultUnlitColorBatched.yy",},
{"name":"BBMOD_ResourceManager","order":18,"path":"scripts/BBMOD_ResourceManager/BBMOD_ResourceManager.yy",},
{"name":"SndPunch","order":4,"path":"sounds/SndPunch/SndPunch.yy",},
Expand Down
3 changes: 3 additions & 0 deletions BBMOD_GML/BBMOD.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/Xshaders/Exposure.xsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
void Exposure()
{
gl_FragColor.rgb = vec3(1.0) - exp(-gl_FragColor.rgb * bbmod_Exposure);
gl_FragColor.rgb *= bbmod_Exposure * bbmod_Exposure;
}
4 changes: 2 additions & 2 deletions BBMOD_GML/Xshaders/Material.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ struct Material
vec3 Lightmap;
};

Material CreateMaterial(mat3 TBN)
Material CreateMaterial()
{
Material m;
m.Base = vec3(1.0);
m.Opacity = 1.0;
m.Normal = normalize(TBN * vec3(0.0, 0.0, 1.0));
m.Normal = vec3(0.0, 0.0, 1.0);
m.Metallic = 0.0;
m.Roughness = 1.0;
m.Specular = vec3(0.0);
Expand Down
10 changes: 7 additions & 3 deletions BBMOD_GML/Xshaders/MetallicMaterial.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Material UnpackMaterial(
sampler2D texBaseOpacity,
float isRoughness,
sampler2D texNormalW,
#if !defined(X_TERRAIN)
float isMetallic,
sampler2D texMaterial,
#if !defined(X_TERRAIN)
#if !defined(X_LIGHTMAP)
sampler2D texSubsurface,
#endif
Expand All @@ -34,7 +34,7 @@ Material UnpackMaterial(
mat3 TBN,
vec2 uv)
{
Material m = CreateMaterial(TBN);
Material m = CreateMaterial();

// Base color and opacity
vec4 baseOpacity = texture2D(texBaseOpacity,
Expand Down Expand Up @@ -69,6 +69,11 @@ Material UnpackMaterial(
}

// Material properties
#if defined(X_TERRAIN)
m.Metallic = 0.0;
m.AO = 1.0;
m.Specular = F0_DEFAULT;
#else
vec4 materialProps = texture2D(texMaterial,
#if defined(X_2D)
mix(bbmod_MaterialUV.xy, bbmod_MaterialUV.zw, uv)
Expand All @@ -90,7 +95,6 @@ Material UnpackMaterial(
m.SpecularPower = exp2(1.0 + (m.Smoothness * 10.0));
}

#if !defined(X_TERRAIN)
#if !defined(X_LIGHTMAP)
// Subsurface (color and intensity)
vec4 subsurface = texture2D(texSubsurface, uv);
Expand Down
2 changes: 2 additions & 0 deletions BBMOD_GML/Xshaders/PBRShader.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma include("DoPointLightPS.xsh")
#pragma include("DoSpotLightPS.xsh")
#pragma include("Exposure.xsh")
#pragma include("TonemapReinhard.xsh")
#pragma include("Fog.xsh")
#pragma include("GammaCorrect.xsh")
#pragma include("IBL.xsh")
Expand Down Expand Up @@ -130,5 +131,6 @@ void PBRShader(Material material, float depth)
Fog(depth);

Exposure();
TonemapReinhard();
GammaCorrect();
}
4 changes: 4 additions & 0 deletions BBMOD_GML/Xshaders/TonemapReinhard.xsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void TonemapReinhard()
{
gl_FragColor.rgb = gl_FragColor.rgb / (vec3(1.0) + gl_FragColor.rgb);
}
13 changes: 10 additions & 3 deletions BBMOD_GML/Xshaders/Uber_PS.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ uniform vec4 bbmod_BaseOpacityMultiplier;

// If 1.0 then the material uses roughness
uniform float bbmod_IsRoughness;
// If 1.0 then the material uses metallic workflow
uniform float bbmod_IsMetallic;
// RGB: Tangent-space normal, A: Smoothness or roughness
uniform sampler2D bbmod_NormalW;
#if !defined(X_TERRAIN)
// If 1.0 then the material uses metallic workflow
uniform float bbmod_IsMetallic;
// RGB: specular color / R: Metallic, G: ambient occlusion
uniform sampler2D bbmod_Material;
#endif

#if !defined(X_TERRAIN)
#if !defined(X_LIGHTMAP)
Expand Down Expand Up @@ -205,6 +207,8 @@ uniform vec3 bbmod_LightPunctualDataB[2 * BBMOD_MAX_PUNCTUAL_LIGHTS];
uniform sampler2D bbmod_Splatmap;
// Splatmap channel to read. Use -1 for none.
uniform int bbmod_SplatmapIndex;
// Colormap texture
uniform sampler2D bbmod_Colormap;
#endif // X_TERRAIN

#if defined(X_PBR)
Expand Down Expand Up @@ -280,9 +284,9 @@ void main()
bbmod_BaseOpacity,
bbmod_IsRoughness,
bbmod_NormalW,
#if !defined(X_TERRAIN)
bbmod_IsMetallic,
bbmod_Material,
#if !defined(X_TERRAIN)
#if !defined(X_LIGHTMAP)
bbmod_Subsurface,
#endif
Expand Down Expand Up @@ -311,6 +315,9 @@ void main()
: ((bbmod_SplatmapIndex == 2) ? splatmap.b
: splatmap.a)));
}

// Colormap
material.Base *= xGammaToLinear(texture2D(bbmod_Colormap, v_vSplatmapCoord).xyz);
#endif

material.Base *= xGammaToLinear(bbmod_BaseOpacityMultiplier.rgb);
Expand Down
2 changes: 2 additions & 0 deletions BBMOD_GML/Xshaders/UnlitShader.xsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma include("Fog.xsh")
#pragma include("Exposure.xsh")
#pragma include("TonemapReinhard.xsh")
#pragma include("GammaCorrect.xsh")
#if defined(X_PARTICLES)
#pragma include("Projecting.xsh")
Expand All @@ -23,5 +24,6 @@ void UnlitShader(Material material, float depth)
#endif
Fog(depth);
Exposure();
TonemapReinhard();
GammaCorrect();
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions BBMOD_GML/objects/OMain/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ if (os_browser == browser_not_a_browser)
}

// Any object/struct that has a render method can be added to the renderer:
renderer.add(batchShell)
.add(global.terrain);
renderer
.add(batchShell)
.add(global.terrain)
;

// Add a refleciton probe
var _terrainWidth = global.terrain.Size.X * global.terrain.Scale.X;
Expand Down
2 changes: 1 addition & 1 deletion BBMOD_GML/objects/OMain/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if (!renderer.UseAppSurface)
{
renderer.present();
}


var _windowWidth = window_get_width();
var _windowHeight = window_get_height();
var _font = draw_get_font();
Expand Down
2 changes: 1 addition & 1 deletion BBMOD_GML/options/amazonfire/options_amazonfire.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/android/options_android.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/html5/options_html5.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/ios/options_ios.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/linux/options_linux.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/mac/options_mac.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/operagx/options_operagx.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/tvos/options_tvos.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/windows/options_windows.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/options/windowsuap/options_windowsuap.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BBMOD_GML/scripts/BBMOD_BaseCamera/BBMOD_BaseCamera.gml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function BBMOD_BaseCamera() constructor
}
var _ray = _forward.Add(_up.Scale(_scaleUp).Add(
_right.Scale((_screenX / _screenWidth) * 2.0 - 1.0)));
return _ray.Normalize();
return _ray;
};

/// @func apply()
Expand Down
Loading

0 comments on commit 05249af

Please sign in to comment.