Skip to content

Commit

Permalink
Fixed particles and SSAO on macOS, increased version to 3.16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kraifpatrik committed Dec 29, 2022
1 parent eb5b3e5 commit 33ae077
Show file tree
Hide file tree
Showing 43 changed files with 195 additions and 166 deletions.
7 changes: 5 additions & 2 deletions BBMOD_GML/Xshaders/Uber_VS.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ void main()
position.xyz = QuaternionRotate(batchRot, position.xyz);
vec3 normal = QuaternionRotate(batchRot, vec3(0.0, 0.0, -1.0));

mat4 W;
W[3][3] = 1.0;
mat4 W = mat4(
vec4(1.0, 0.0, 0.0, 0.0),
vec4(0.0, 1.0, 0.0, 0.0),
vec4(0.0, 0.0, 1.0, 0.0),
vec4(0.0, 0.0, 0.0, 1.0));
W[3].xyz += batchPosition;
mat4 V = gm_Matrices[MATRIX_VIEW];
mat4 P = gm_Matrices[MATRIX_PROJECTION];
Expand Down

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

80 changes: 40 additions & 40 deletions BBMOD_GML/objects/OMain/OMain.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/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.

Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ function BBMOD_BaseRenderer()

PostProcessor.draw(__surFinal, X, Y);
}


return self;
};

Expand Down
20 changes: 10 additions & 10 deletions BBMOD_GML/scripts/BBMOD_BaseRenderer/BBMOD_BaseRenderer.yy

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

Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function BBMOD_DefaultRenderer()

surface_set_target(__surDepthBuffer);
draw_clear(c_white);
matrix_set(matrix_view, _view);
matrix_set(matrix_view, _view);
matrix_set(matrix_projection, _projection);
bbmod_render_pass_set(BBMOD_ERenderPass.DepthOnly);
var _rqi = 0;
Expand All @@ -159,7 +159,9 @@ function BBMOD_DefaultRenderer()

__surSSAO = bbmod_surface_check(__surSSAO, _width, _height);
__surWork = bbmod_surface_check(__surWork, _width, _height);


bbmod_material_reset();

bbmod_ssao_draw(SSAORadius * SSAOScale, SSAOPower, SSAOAngleBias,
SSAODepthRange, __surSSAO, __surWork, __surDepthBuffer, _projection,
bbmod_camera_get_zfar());
Expand Down
20 changes: 10 additions & 10 deletions BBMOD_GML/scripts/BBMOD_DefaultRenderer/BBMOD_DefaultRenderer.yy

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

20 changes: 10 additions & 10 deletions BBMOD_GML/scripts/__bbmod_particles/__bbmod_particles.yy

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

26 changes: 12 additions & 14 deletions BBMOD_GML/scripts/__bbmod_ssao/__bbmod_ssao.gml
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ function bbmod_ssao_draw(
gpu_push_state();
gpu_set_tex_repeat(false);

var _cam = camera_create();
static _cam = camera_create();
camera_set_view_size(_cam, _width, _height);

gpu_set_tex_filter(false);

surface_set_target(_surSsao);
matrix_set(matrix_world, matrix_build_identity());
camera_apply(_cam);
matrix_set(matrix_world, matrix_build_identity());
draw_clear(c_white);
shader_set(BBMOD_ShSSAO);
texture_set_stage(_uTexNoise, sprite_get_texture(global.__bbmodSSAONoise, 0));
Expand All @@ -159,31 +159,29 @@ function bbmod_ssao_draw(

gpu_set_tex_filter(true);

shader_set(BBMOD_ShSSAOBlur);
shader_set_uniform_f(_uBlurTexel, 1.0 / _width, 0.0);
shader_set_uniform_f(_uBlurClipFar, _clipFar);
texture_set_stage(_uBlurTexDepth, surface_get_texture(_surDepth));
gpu_set_tex_filter_ext(_uBlurTexDepth, false);

surface_set_target(_surWork);
camera_apply(_cam);
matrix_set(matrix_world, matrix_build_identity());
draw_clear(0);
shader_set(BBMOD_ShSSAOBlur);
shader_set_uniform_f(_uBlurTexel, 1.0 / _width, 0.0);
shader_set_uniform_f(_uBlurClipFar, _clipFar);
texture_set_stage(_uBlurTexDepth, surface_get_texture(_surDepth));
gpu_set_tex_filter_ext(_uBlurTexDepth, false);
draw_surface(_surSsao, 0, 0);
shader_reset();
surface_reset_target();

surface_set_target(_surSsao);
camera_apply(_cam);
matrix_set(matrix_world, matrix_build_identity());
draw_clear(0);
shader_set(BBMOD_ShSSAOBlur);
shader_set_uniform_f(_uBlurTexel, 0.0, 1.0 / _height);
shader_set_uniform_f(_uBlurClipFar, _clipFar);
texture_set_stage(_uBlurTexDepth, surface_get_texture(_surDepth));
gpu_set_tex_filter_ext(_uBlurTexDepth, false);
draw_surface(_surWork, 0, 0);
shader_reset();
surface_reset_target();

shader_reset();

gpu_pop_state();

camera_destroy(_cam);
}
21 changes: 10 additions & 11 deletions BBMOD_GML/scripts/__bbmod_ssao/__bbmod_ssao.yy

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

2 changes: 2 additions & 0 deletions BBMOD_GML/shaders/BBMOD_ShDefault/BBMOD_ShDefault.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ vec2 xUnproject(vec4 p)
{
vec2 uv = p.xy / p.w;
uv = uv * 0.5 + 0.5;
#if defined(_YY_HLSL11_) || defined(_YY_PSSL_)
uv.y = 1.0 - uv.y;
#endif
return uv;
}
/// @param d Linearized depth to encode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,9 @@ vec2 xUnproject(vec4 p)
{
vec2 uv = p.xy / p.w;
uv = uv * 0.5 + 0.5;
#if defined(_YY_HLSL11_) || defined(_YY_PSSL_)
uv.y = 1.0 - uv.y;
#endif
return uv;
}
/// @param d Linearized depth to encode.
Expand Down
Loading

0 comments on commit 33ae077

Please sign in to comment.