Skip to content

Commit 8867deb

Browse files
committed
Initial commit
0 parents  commit 8867deb

63 files changed

Lines changed: 5969 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
## Java
2+
3+
*.class
4+
*.war
5+
*.ear
6+
hs_err_pid*
7+
8+
## Robovm
9+
/ios/robovm-build/
10+
11+
## GWT
12+
/html/war/
13+
/html/gwt-unitCache/
14+
.apt_generated/
15+
.gwt/
16+
gwt-unitCache/
17+
www-test/
18+
.gwt-tmp/
19+
20+
## Android Studio and Intellij and Android in general
21+
/android/libs/armeabi/
22+
/android/libs/armeabi-v7a/
23+
/android/libs/arm64-v8a/
24+
/android/libs/x86/
25+
/android/libs/x86_64/
26+
/android/gen/
27+
.idea/
28+
*.ipr
29+
*.iws
30+
*.iml
31+
/android/out/
32+
com_crashlytics_export_strings.xml
33+
34+
## Eclipse
35+
36+
.classpath
37+
.project
38+
.metadata/
39+
/android/bin/
40+
/core/bin/
41+
/desktop/bin/
42+
/html/bin/
43+
/ios/bin/
44+
/ios-moe/bin/
45+
*.tmp
46+
*.bak
47+
*.swp
48+
*~.nib
49+
.settings/
50+
.loadpath
51+
.externalToolBuilders/
52+
*.launch
53+
54+
## NetBeans
55+
56+
/nbproject/private/
57+
/android/nbproject/private/
58+
/core/nbproject/private/
59+
/desktop/nbproject/private/
60+
/html/nbproject/private/
61+
/ios/nbproject/private/
62+
/ios-moe/nbproject/private/
63+
64+
/build/
65+
/android/build/
66+
/core/build/
67+
/desktop/build/
68+
/html/build/
69+
/ios/build/
70+
/ios-moe/build/
71+
72+
/nbbuild/
73+
/android/nbbuild/
74+
/core/nbbuild/
75+
/desktop/nbbuild/
76+
/html/nbbuild/
77+
/ios/nbbuild/
78+
/ios-moe/nbbuild/
79+
80+
/dist/
81+
/android/dist/
82+
/core/dist/
83+
/desktop/dist/
84+
/html/dist/
85+
/ios/dist/
86+
/ios-moe/dist/
87+
88+
/nbdist/
89+
/android/nbdist/
90+
/core/nbdist/
91+
/desktop/nbdist/
92+
/html/nbdist/
93+
/ios/nbdist/
94+
/ios-moe/nbdist/
95+
96+
nbactions.xml
97+
nb-configuration.xml
98+
99+
## Gradle
100+
101+
/local.properties
102+
.gradle/
103+
gradle-app.setting
104+
/build/
105+
/android/build/
106+
/core/build/
107+
/desktop/build/
108+
/html/build/
109+
/ios/build/
110+
/ios-moe/build/
111+
112+
## OS Specific
113+
.DS_Store
114+
Thumbs.db
115+
116+
## iOS
117+
/ios/xcode/*.xcodeproj/*
118+
!/ios/xcode/*.xcodeproj/xcshareddata
119+
!/ios/xcode/*.xcodeproj/project.pbxproj
120+
/ios/xcode/native/
121+
/ios/IOSLauncher.app
122+
/ios/IOSLauncher.app.dSYM
123+
124+
/ios-moe/xcode/*.xcodeproj/*
125+
!/ios-moe/xcode/*.xcodeproj/xcshareddata
126+
!/ios-moe/xcode/*.xcodeproj/project.pbxproj
127+
/ios-moe/xcode/native/

BuildKey.jks

2.15 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# DeltaCore_

build.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
buildscript {
2+
3+
4+
repositories {
5+
mavenLocal()
6+
mavenCentral()
7+
maven { url "https://plugins.gradle.org/m2/" }
8+
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
9+
jcenter()
10+
google()
11+
}
12+
dependencies {
13+
classpath 'com.android.tools.build:gradle:4.0.0'
14+
}
15+
}
16+
17+
allprojects {
18+
19+
version = '1.0'
20+
ext {
21+
appName = "FlappyDemon"
22+
gdxVersion = '1.9.10'
23+
roboVMVersion = '2.3.7'
24+
box2DLightsVersion = '1.4'
25+
ashleyVersion = '1.7.0'
26+
aiVersion = '1.8.0'
27+
}
28+
29+
repositories {
30+
mavenLocal()
31+
mavenCentral()
32+
jcenter()
33+
google()
34+
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
35+
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
36+
}
37+
}
38+
39+
project(":desktop") {
40+
apply plugin: "java-library"
41+
42+
43+
dependencies {
44+
implementation project(":core")
45+
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
46+
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
47+
api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
48+
49+
}
50+
}
51+
52+
project(":core") {
53+
apply plugin: "java-library"
54+
55+
dependencies {
56+
api "com.badlogicgames.gdx:gdx:$gdxVersion"
57+
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
58+
}
59+
}

core/assets/font2(old).fnt

Lines changed: 222 additions & 0 deletions
Large diffs are not rendered by default.

core/assets/font2(old).png

14 KB
Loading

core/assets/shaders/bias.fragment

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*******************************************************************************
2+
* Copyright 2012 tsagrista
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
#ifdef GL_ES
18+
precision mediump float;
19+
precision mediump int;
20+
#endif
21+
22+
uniform sampler2D u_texture0;
23+
uniform float u_bias;
24+
varying vec2 v_texCoords;
25+
26+
void main()
27+
{
28+
vec4 tex = texture2D(u_texture0, v_texCoords);
29+
float avg = (tex.r + tex.g + tex.b) / 3.0;
30+
gl_FragColor = vec4(max(0.0, avg + u_bias)) * 50.0;
31+
}

core/assets/shaders/blur.fragment

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*******************************************************************************
2+
* Copyright 2012 bmanuel
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
#ifdef GL_ES
18+
#define PRECISION mediump
19+
precision PRECISION float;
20+
#else
21+
#define PRECISION
22+
#endif
23+
24+
#ifndef RADIUS
25+
#error Please define a RADIUS
26+
#endif
27+
28+
#define KERNEL_SIZE (RADIUS * 2 + 1)
29+
30+
varying vec2 v_texCoord0;
31+
uniform PRECISION sampler2D u_texture0;
32+
uniform PRECISION vec2 SampleOffsets[KERNEL_SIZE];
33+
uniform PRECISION float SampleWeights[KERNEL_SIZE];
34+
35+
void main()
36+
{
37+
vec4 c = vec4(0);
38+
39+
// Combine a number of weighted image filter taps.
40+
for (int i = 0; i < KERNEL_SIZE; i++)
41+
{
42+
c += texture2D(u_texture0, v_texCoord0 + SampleOffsets[i]) * SampleWeights[i];
43+
}
44+
45+
gl_FragColor = c;
46+
}

core/assets/shaders/blur.vertex

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*******************************************************************************
2+
* Copyright 2012 bmanuel
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
#ifdef GL_ES
18+
#define PRECISION mediump
19+
precision PRECISION float;
20+
#else
21+
#define PRECISION
22+
#endif
23+
24+
attribute vec4 a_position;
25+
attribute vec2 a_texCoord0;
26+
varying vec2 v_texCoord0;
27+
28+
void main()
29+
{
30+
v_texCoord0 = a_texCoord0;
31+
gl_Position = a_position;
32+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*******************************************************************************
2+
* Copyright 2012 bmanuel
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
#ifdef GL_ES
18+
#define PRECISION mediump
19+
precision PRECISION float;
20+
#else
21+
#define PRECISION
22+
#endif
23+
24+
25+
uniform PRECISION sampler2D u_texture0; // scene
26+
uniform PRECISION sampler2D u_texture1; // depthmap
27+
uniform PRECISION mat4 ctp;
28+
uniform PRECISION float near, far;
29+
uniform vec2 viewport;
30+
uniform mat4 inv_proj;
31+
uniform float blur_scale;
32+
uniform float depth_scale;
33+
uniform int blur_passes;
34+
35+
varying vec2 v_texCoords;
36+
37+
vec3 get_eye_normal(){
38+
vec2 frag_coord = gl_FragCoord.xy/viewport;
39+
frag_coord = (frag_coord-0.5)*2.0;
40+
vec4 device_normal = vec4(frag_coord, 0.0, 1.0);
41+
return normalize((inv_proj * device_normal).xyz);
42+
}
43+
44+
vec3 decode_normal(vec2 enc){
45+
vec2 fenc = enc*4.0-2.0;
46+
float f = dot(fenc,fenc);
47+
float g = sqrt(1.0-f/4.0);
48+
return vec3(fenc*g, 1.0-f/2.0);
49+
}
50+
51+
float decode_depth(vec2 src){
52+
float depth = src.x/255.0+src.y;
53+
depth *= depth_scale;
54+
return depth*far+near;
55+
}
56+
57+
void main() {
58+
vec3 eye_ray = get_eye_normal();
59+
vec4 eye_data = texture2D(u_texture1, v_texCoords);
60+
vec3 eye_normal = decode_normal(eye_data.xy);
61+
float eye_depth = decode_depth(eye_data.zw);
62+
63+
vec4 current = vec4(eye_ray * eye_depth, 1.0);
64+
vec4 previous = ctp * current;
65+
previous.xyz /= previous.w;
66+
previous.xy = previous.xy * 0.5 + 0.5;
67+
68+
vec2 velocity = (previous.xy - v_texCoords) * 0.5 * blur_scale;
69+
70+
// blur pass
71+
vec4 result = vec4(0.0);
72+
float oneOnNumPasses = 1.0 / float(blur_passes);
73+
74+
for (int i = 0; i < blur_passes; ++i) {
75+
// make offset in [-0.5, 0.5] range
76+
float scale = (float(i) * oneOnNumPasses) - 0.5;
77+
vec2 offset = scale * velocity;
78+
result += texture2D(u_texture0, v_texCoords + offset);
79+
}
80+
81+
//// Get the initial color at this pixel.
82+
//result = texture2D(u_texture0, v_texCoords);
83+
//vec2 texCoord = v_texCoords + velocity;
84+
//for(int i = 1; i < blur_passes; ++i, texCoord += velocity)
85+
//{
86+
//// Add the current color to our color sum.
87+
//result += texture2D(u_texture0, texCoord);
88+
//}
89+
90+
gl_FragColor = result * oneOnNumPasses;
91+
}

0 commit comments

Comments
 (0)