List of commits:
Subject Hash Author Date (UTC)
Add sprite rim lighting eb9ade21b6253e050d6962c273187f090c20ff2a mse 2021-11-18 01:29:22
Bump version to v0.6.4 c2aeae76122cc95d03756a55a528b62609762820 mse 2021-11-17 11:38:37
Attempt to fix JSON serializing in locales with commas beae8b63fb0deaaf0b66ef4f188df270120ebe1c mse 2021-11-17 11:19:18
Limit network settings to network-enabled builds 8ccef75176b9059a45afa9ea251c313be7b7cfe0 mse 2021-11-17 09:20:56
Add /fps console command 207ef051937c91f78dae3928ef004ee7aa7f2a7a mse 2021-11-16 21:33:32
Move userdata to game root directory f9bff9bb941b714e7c0987327804175d852b470b mse 2021-11-16 02:55:04
Add --savehere flag and bump version to v0.6.3 a59633113908903af57e4e1c62008fe154d4cbb7 mse 2021-11-16 02:12:25
Disable networking and remove dead code aaa8bd8300f89099bace4ee1de374d05dff2c089 mse 2021-11-15 05:17:06
Update gamecontrollerdb 828ce88dd2107d69b6332b9768f7c556473b8a24 mse 2021-11-14 00:29:26
Bump version to 0.6.2 baa2215230b5deed37b69f4075bd3b3385dbb913 mse 2021-11-14 00:08:13
Fix controller menu selection 3a1567ae279289d72058d6aa23d0c4eb147db2a8 mse 2021-11-13 23:00:12
Chinese translations for confec-select and name-your-confec 6c5c9d0fadb17066af82d459d1d46868af0e9faa mse 2021-11-13 20:58:26
Parse newlines in CSL notifications fc21ba1563a1c36ff20711c84b0dc3f3d7588646 mse 2021-11-13 05:12:11
Scriptable special items: GIVESPECIAL <id> <name> 256a2581e75dc3762b098f8cae3259899f8c4a94 mse 2021-11-13 03:24:02
Improved particles, darker nights, work on GIVESPECIAL e8e352e03fdffb8a8e57f94f99028bc1c6c03376 mse 2021-11-12 08:51:36
Fix caption padding bug a49cd2397d2e1b98679828303116db858d146a93 mse 2021-11-08 23:35:07
Disable is_regular_file for Boost support ebee78afad8b29f0332a4cf719c7c4d70e8c9ff8 mse 2021-11-08 22:41:42
Bump version to 0.6.1 9bdeecf9d39b75d12e44cb65bbb97a2e8277fcd4 mse 2021-11-08 21:34:25
Improve caption printing and start work on GIVESPECIAL ec51488e4fd5552ae6d22db1b6eedfef7c2541b7 mse 2021-11-08 20:29:59
Load current screen's images for CSL support 43ef06272048c164fc754a547a57859bdfb909db mse 2021-11-06 03:23:56
Commit eb9ade21b6253e050d6962c273187f090c20ff2a - Add sprite rim lighting
Author: mse
Author date (UTC): 2021-11-18 01:29
Committer name: mse
Committer date (UTC): 2021-11-18 01:29
Parent(s): c2aeae76122cc95d03756a55a528b62609762820
Signing key:
Tree: 01bb6117d6c7da28caccb3a6f3d799c9cc659254
File Lines added Lines deleted
base/glsl/rimlit_sprite.frag 19 0
base/glsl/rimlit_sprite.vert 0 0
confec.cpp 38 3
File base/glsl/rimlit_sprite.frag added (mode: 100644) (index 0000000..64c840a)
1 uniform sampler2D u_texture;
2 uniform vec4 u_fog;
3 uniform vec2 u_sun;
4 in vec2 v_UV;
5 in vec4 v_RelativePos;
6 layout(location = 0) out vec4 fragColor;
7
8 void main(){
9 vec4 texColor = texture( u_texture, v_UV );
10 if( texColor.a < 0.001 ) discard;
11 vec2 tUV = v_UV + u_sun / textureSize( u_texture, 0 );
12 if( tUV.x < 0.0 || tUV.y < 0.0 || tUV.x > 1.0 || tUV.y > 1.0 ){
13 texColor.rgb *= 1.5;
14 }else{
15 texColor.rgb *=
16 1.0 + 0.5 * ( 1.0 - texture( u_texture, tUV ).a );
17 }
18 fragColor = texColor * u_fog;
19 }
File base/glsl/rimlit_sprite.vert copied from file base/glsl/postfx.vert (similarity 100%)
File confec.cpp changed (mode: 100644) (index ea83568..be6012f)
... ... GLfloat
531 531 bloomThreshold = 0.56f, bloomThreshold = 0.56f,
532 532 bloomAmount = 0.25f; bloomAmount = 0.25f;
533 533
534 fgl::Pipeline bloomPipeline, sunlitInstancePipeline;
534 fgl::Pipeline bloomPipeline, rimlitSpritePipeline, sunlitInstancePipeline;
535 535
536 536 std::string fadeTo = ""; std::string fadeTo = "";
537 537
 
... ... void Tick();
812 812
813 813 void TurboSleep(); void TurboSleep();
814 814
815 void UpdateRimSun();
816
815 817 void UpdateRichPresence(); void UpdateRichPresence();
816 818
817 819 void UpdateSpecialItems(); void UpdateSpecialItems();
 
... ... int main( int argc, char* argv[] ){
1103 1105 data_path + "/glsl/postfx.frag", data_path + "/glsl/postfx.frag",
1104 1106 { "u_texture" } { "u_texture" }
1105 1107 ); );
1108 rimlitSpritePipeline = LoadShaders(
1109 data_path + "/glsl/rimlit_sprite.vert",
1110 data_path + "/glsl/rimlit_sprite.frag",
1111 { "u_texture" }
1112 );
1106 1113 sunlitInstancePipeline = LoadShaders( sunlitInstancePipeline = LoadShaders(
1107 1114 data_path + "/glsl/sunlit_instance.vert", data_path + "/glsl/sunlit_instance.vert",
1108 1115 data_path + "/glsl/sunlit_instance.frag", data_path + "/glsl/sunlit_instance.frag",
 
... ... void vnDraw( double sw, double sh ){
2067 2074 hudOffX = vnOffX; hudOffX = vnOffX;
2068 2075 } }
2069 2076
2070 // Configure the pipeline for 2D drawing.
2077 // Configure the pipeline for UI drawing.
2071 2078 //fgl::setPipeline( fgl::unlitPipeline ); //fgl::setPipeline( fgl::unlitPipeline );
2072 2079 fgl::setPipeline( fgl::colorModPipeline ); fgl::setPipeline( fgl::colorModPipeline );
2073 2080 glDisable( GL_DEPTH_TEST ); glDisable( GL_DEPTH_TEST );
 
... ... void TurboSleep(){
4080 4087 } }
4081 4088 } }
4082 4089
4090 // Update the sun position for sprite rim lighting.
4091 void UpdateRimSun(){
4092 float angle = player_time * 6.283;
4093 auto sun = linalg::normalize( linalg::vec<float,2>(
4094 std::sin( angle ),
4095 std::cos( angle )
4096 ) ) * 2.0f;
4097 if( sun.y > 0.0f ) sun *= 1.0f - std::min( sun.y / 0.2f, 1.0f );
4098 glUniform2f(
4099 glGetUniformLocation( rimlitSpritePipeline.programObject, "u_sun" ),
4100 sun.x,
4101 sun.y
4102 );
4103 }
4104
4083 4105 void UpdateRichPresence(){ void UpdateRichPresence(){
4084 4106 #ifdef __STEAM__ #ifdef __STEAM__
4085 4107 if( use_steam && !is_steam_china ){ if( use_steam && !is_steam_china ){
 
... ... void Render(){
4682 4704 circleY = DBL_INF; circleY = DBL_INF;
4683 4705 // Reset blend mode. // Reset blend mode.
4684 4706 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
4707 // Draw the bottom layers with only ambient lighting.
4708 fgl::setPipeline( fgl::colorModPipeline );
4685 4709 // Day/night tinting. // Day/night tinting.
4686 4710 fgl::setFog( ambient_light ); fgl::setFog( ambient_light );
4687 4711 // Draw the world (fade in/fade out edition) // Draw the world (fade in/fade out edition)
 
... ... void Render(){
4689 4713 world.drawMap(); world.drawMap();
4690 4714 SimulateParticles( d ); SimulateParticles( d );
4691 4715 DrawFloorParticles(); DrawFloorParticles();
4716 // Draw the entities with rim lighting.
4717 fgl::setPipeline( rimlitSpritePipeline );
4718 UpdateRimSun();
4692 4719 if( multiplayer ) if( multiplayer )
4693 4720 world.drawEntities( ws_entities ); world.drawEntities( ws_entities );
4694 4721 else else
 
... ... void Render(){
4706 4733 bloomAmount / bloomFactor bloomAmount / bloomFactor
4707 4734 } ); } );
4708 4735 fgl::drawFramebuffer( framebuffer ); fgl::drawFramebuffer( framebuffer );
4736 // Switch back to the color mod pipeline for UI drawing.
4709 4737 fgl::setPipeline( fgl::colorModPipeline ); fgl::setPipeline( fgl::colorModPipeline );
4710 4738 fgl::setFog( { 1.0f, 1.0f, 1.0f, 1.0f } ); fgl::setFog( { 1.0f, 1.0f, 1.0f, 1.0f } );
4711 4739 }else if( true }else if( true
 
... ... void GameLoop( double d ){
5860 5888 world.cursorX = fgl::mouseX; world.cursorX = fgl::mouseX;
5861 5889 world.cursorY = fgl::mouseY; world.cursorY = fgl::mouseY;
5862 5890
5891 // Draw the bottom layers with only ambient lighting.
5892 fgl::setPipeline( fgl::colorModPipeline );
5893
5863 5894 // Day/night tinting. // Day/night tinting.
5864 5895 fgl::setFog( ambient_light ); fgl::setFog( ambient_light );
5865 5896
 
... ... void GameLoop( double d ){
5930 5961 e.last_y += vel_y * d; e.last_y += vel_y * d;
5931 5962 } }
5932 5963 } }
5964 // Draw the entities with rim lighting.
5965 fgl::setPipeline( rimlitSpritePipeline );
5966 UpdateRimSun();
5933 5967 if( multiplayer ) if( multiplayer )
5934 5968 world.drawEntities( ws_entities ); world.drawEntities( ws_entities );
5935 5969 else else
 
... ... void GameLoop( double d ){
6143 6177 } }
6144 6178
6145 6179 // This is where circles would be drawn if they were on top. // This is where circles would be drawn if they were on top.
6180 // Be sure to switch to the correct pipeline.
6146 6181 } }
6147 6182
6148 6183 // It is once again safe to use pathfinding. // It is once again safe to use pathfinding.
 
... ... void GameLoop( double d ){
6163 6198 ? ( 0.0f ) : ( bloomAmount ) ? ( 0.0f ) : ( bloomAmount )
6164 6199 } ); } );
6165 6200 fgl::drawFramebuffer( framebuffer ); fgl::drawFramebuffer( framebuffer );
6166
6201 // Switch back to the color mod pipeline for UI drawing.
6167 6202 fgl::setPipeline( fgl::colorModPipeline ); fgl::setPipeline( fgl::colorModPipeline );
6168 6203
6169 6204 fgl::setFog( { 1.0f, 1.0f, 1.0f, 1.0f } ); fgl::setFog( { 1.0f, 1.0f, 1.0f, 1.0f } );
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using git:
git clone git://git.rocketgit.com/user/mse/ConfectionerEngine

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main