-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e193b97
commit e7fda29
Showing
15 changed files
with
148 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/library/java/gg/generations/rarecandy/pokeutils/UnlitMaterialReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package gg.generations.rarecandy.pokeutils; | ||
|
||
public class UnlitMaterialReference extends DiffuseMaterialReference { | ||
@Override | ||
public String shader() { | ||
return "unlit"; | ||
} | ||
|
||
public UnlitMaterialReference(String texture) { | ||
super(texture); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#version 450 core | ||
#define ambientLight 0.6f | ||
|
||
in vec2 texCoord0; | ||
|
||
out vec4 outColor; | ||
|
||
uniform sampler2D diffuse; | ||
|
||
uniform float lightLevel; | ||
|
||
void main() { | ||
vec4 color = texture2D(diffuse, texCoord0); | ||
|
||
if (color.a < 0.01) discard; | ||
|
||
outColor = vec4(lightLevel, lightLevel, lightLevel, 1.0f) * color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/library/resources/shaders/animated/transparent_pbr.fs.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#version 450 core | ||
#define ambientLight 0.6f | ||
|
||
in vec2 texCoord0; | ||
in vec3 normal; | ||
in vec3 toLightVector; | ||
in vec3 toCameraVector; | ||
|
||
out vec4 outColor; | ||
|
||
uniform sampler2D diffuse; | ||
|
||
uniform int intColor; | ||
uniform float shineDamper; | ||
uniform float reflectivity; | ||
uniform float diffuseColorMix; | ||
uniform float alpha; | ||
|
||
vec3 intToColor() { | ||
return vec3((intColor >> 16 & 255) / 255.0, (intColor >> 8 & 255) / 255.0, (intColor & 255) / 255.0); | ||
} | ||
|
||
void main() { | ||
vec4 color = texture2D(diffuse, texCoord0); | ||
|
||
vec3 lightColor = intToColor(); | ||
vec3 pixelmonColor = mix(lightColor, vec3(1.0, 1.0, 1.0), diffuseColorMix); | ||
vec3 unitNormal = normalize(normal); | ||
vec3 unitLightVector = normalize(toLightVector); | ||
vec3 lightDir = -unitLightVector; | ||
vec3 unitToCameraVector = normalize(toCameraVector); | ||
|
||
// Diffuse Lighting | ||
float rawDiffuse = dot(unitNormal, unitLightVector); | ||
float diffuse = max(rawDiffuse, ambientLight); | ||
vec3 coloredDiffuse = diffuse * pixelmonColor; | ||
|
||
// Specular Lighting | ||
vec3 reflectedLightDir = reflect(lightDir, unitNormal); | ||
float rawSpecularFactor = dot(reflectedLightDir, unitToCameraVector); | ||
float specularFactor = max(rawSpecularFactor, 0.0f); | ||
float dampedFactor = pow(specularFactor, shineDamper); | ||
vec3 finalSpecular = dampedFactor * reflectivity * lightColor; | ||
|
||
outColor = vec4(coloredDiffuse, 1.0f) * color + vec4(finalSpecular, 1.0f); | ||
outColor.a = color.a; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#version 450 core | ||
#define ambientLight 0.6f | ||
|
||
in vec2 texCoord0; | ||
|
||
out vec4 outColor; | ||
|
||
uniform sampler2D diffuse; | ||
|
||
void main() { | ||
vec4 color = texture2D(diffuse, texCoord0); | ||
outColor = color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters