Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
remexre committed Nov 22, 2018
1 parent 54b418b commit e3ca96f
Show file tree
Hide file tree
Showing 21 changed files with 670 additions and 346 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
18 changes: 18 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ rayon = "1.0.3"
serde = "1.0.80"
serde_derive = "1.0.80"
serde_json = "1.0.33"
smallvec = "0.6.6"
stderrlog = "0.4.1"
structopt = "0.2.13"
typemap = "0.3.3"
symbol = "0.1.7"
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
csci5607-game
=============

Notes
-----

So I get that this it's probably a waste of time, but I'm pretty proud of myself for making it so I can iterate "over all entities" and it'll infer which components should actually be selected, skipping entities that don't have them.
32 changes: 12 additions & 20 deletions maps/main.frag
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,29 @@

uniform bool textured;
uniform sampler2D tex;
uniform vec3 ambient;
uniform vec3 diffuse;

/*
in vec3 color;
in vec3 adjNormal;
in vec3 pos;
in vec3 lightDir;
*/
in vec2 texcoords;

out vec4 outColor;

const float ambient = 0.0;

void main() {
/*
vec3 ambient = color * ambient;
vec3 ambientC;
vec3 diffuseC;

vec3 diffuse = color * max(dot(-lightDir, adjNormal), 0.0);
vec3 viewDir = normalize(-pos);
vec3 reflectDir = reflect(viewDir, adjNormal);
float spec = max(dot(reflectDir, lightDir), 0.0);
if(dot(-lightDir, adjNormal) <= 0.0)
spec = 0.0;
vec3 specular = vec3(0.8) * pow(spec, 4);
outColor = vec4(ambient + diffuse + specular, 1);
*/
if(textured) {
outColor = texture(tex, texcoords);
ambientC = diffuseC = texture(tex, texcoords).rgb;
} else {
outColor = vec4(1.0);
ambientC = ambient;
diffuseC = diffuse;
}

ambientC *= 0.1;
diffuseC *= max(dot(-lightDir, adjNormal), 0.0);

outColor = vec4(ambientC + diffuseC, 1.0);
}
17 changes: 4 additions & 13 deletions maps/main.vert
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,19 @@ in vec3 xyz;
in vec3 normal;
in vec2 uv;

out vec2 texcoords;

/*
const vec3 inLightDir = normalize(vec3(-1, -1, -1));
out vec3 color;
out vec3 adjNormal;
out vec3 pos;
out vec3 lightDir;
*/
out vec2 texcoords;

const vec3 inLightDir = normalize(vec3(1.0, 2.0, 1.0));

void main() {
gl_Position = proj * view * model * vec4(xyz, 1.0);
/*
color = inColor;

vec4 norm4 = transpose(inverse(view * model)) * vec4(normal, 0.0);
adjNormal = normalize(norm4.xyz);

pos = (view * model * vec4(xyz, 1.0)).xyz;
lightDir = (view * vec4(inLightDir, 0.0)).xyz;
*/
// gl_Position = vec4(xyz.xzy, 1.0);

texcoords = uv;
}
3 changes: 3 additions & 0 deletions maps/stonewall-bump.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions maps/stonewall.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 12 additions & 8 deletions maps/textured.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
{
"dims": [
5,
5
],
"floor": [
"dims": [5, 5],
"tiles": [
"e", "e", "e", "e", "e",
"w", "w", "e", "w", "e",
"e", "w", { "d": "A" }, "w", "e",
"e", "w", "e", "w", "w",
"e", "e", "e", "e", "e"
],
"start": [0, 4],
"goal": [4, 0],
"keys": [
[4, 4, "a"]
],
"clear_color": [0.0, 0.0, 0.1, 1.0],
"clear_color": [0.0, 0.0, 0.01, 1.0],
"door_colors": [
[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0],
[1.0, 1.0, 0.0],
[0.0, 1.0, 1.0]
],
"material_floor": "floor.mtl",
"material_wall": "wall.mtl",
"model_character": null,
"model_key": "key.obj",
"shader_frag": "main.frag",
"shader_vert": "main.vert"
}
3 changes: 2 additions & 1 deletion maps/wall.mtl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Kd 1.000 1.000 1.000
Ks 0.000 0.000 0.000
d 1.0
illum 2
map_Kd wall.png
map_Kd stonewall.jpg
map_bump stonewall-bump.png
99 changes: 0 additions & 99 deletions src/bin/rendertest.rs

This file was deleted.

Loading

0 comments on commit e3ca96f

Please sign in to comment.