stone voxel type, lighting fixes, anim fix
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-09-24 21:11:37 -04:00
parent dd415681bb
commit 95695188e3
15 changed files with 127 additions and 55 deletions

View File

@ -123,7 +123,7 @@
]
},
{
"voxelTypeIds" : [4],
"voxelTypeIds" : [4,6],
"footstepRegularBareAudioPaths" : [
"Audio/movement/surface/stone/Bare Step Stone Medium A.wav",
"Audio/movement/surface/stone/Bare Step Stone Medium B.wav",

View File

@ -552,7 +552,7 @@
"idleData": {
"animation": {
"nameFirstPerson" : "BindPose",
"nameThirdPerson" : "Idle",
"nameThirdPerson" : "Idle1",
"priorityCategory" : "IDLE"
}
},

View File

@ -436,7 +436,7 @@
"idleData": {
"animation": {
"nameFirstPerson" : "Idle",
"nameThirdPerson" : "Idle",
"nameThirdPerson" : "Idle1",
"priorityCategory" : "IDLE"
}
},

View File

@ -31,6 +31,11 @@
"id" : 5,
"name" : "snow",
"texture" : "/Textures/Ground/snow1_256.jpg"
},
{
"id" : 6,
"name" : "stone",
"texture" : "/Textures/Ground/cliff1_256.png"
}
]
}

View File

@ -1,50 +1,39 @@
#version 330 core
#version 450 core
/**
Bind points for different SSBOs
*/
#define DIRECT_LIGHT_SSBO_BIND_POINT 3
/**
transparency
*/
#define SMALL_EPSILON 0.001
/**
The direct global light
*/
struct DirectLight {
vec3 direction;
vec3 color;
};
out vec4 FragColor;
layout(std430, binding = DIRECT_LIGHT_SSBO_BIND_POINT) restrict buffer dirLightSSBO {
DirectLight directLight;
};
struct Material {
sampler2D diffuse;
sampler2D specular;
float shininess;
};
struct DirLight {
vec3 direction;
vec3 ambient;
vec3 diffuse;
vec3 specular;
};
struct PointLight {
vec3 position;
float constant;
float linear;
float quadratic;
vec3 ambient;
vec3 diffuse;
vec3 specular;
};
struct SpotLight {
vec3 position;
vec3 direction;
float cutOff;
float outerCutOff;
float constant;
float linear;
float quadratic;
vec3 ambient;
vec3 diffuse;
vec3 specular;
};
#define NR_POINT_LIGHTS 10
in vec3 FragPos;
in vec3 Normal;
@ -52,9 +41,6 @@ in vec2 TexCoord;
in vec4 FragPosLightSpace;
uniform vec3 viewPos;
uniform DirLight dirLight;
uniform PointLight pointLights[NR_POINT_LIGHTS];
uniform SpotLight spotLight;
uniform Material material;
//texture stuff
@ -65,6 +51,9 @@ uniform int hasTransparency;
//light depth map
uniform sampler2D shadowMap;
// function prototypes
float calcLightIntensityTotal(vec3 normal);
void main(){
if(hasTransparency == 1){
@ -72,5 +61,29 @@ void main(){
discard;
}
}
FragColor = texture(material.diffuse, TexCoord);
vec4 textureColor = texture(material.diffuse, TexCoord);
//grab light intensity
vec3 norm = normalize(Normal);
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
//calculate final color
vec3 finalColor = textureColor.rgb * lightIntensity;
FragColor = vec4(finalColor, textureColor.a);
}
float calcLightIntensityAmbient(){
//calculate average of ambient light
float avg = (directLight.color.x + directLight.color.y + directLight.color.z)/3.0;
return avg;
}
//
float calcLightIntensityTotal(vec3 normal){
//ambient intensity
float ambientLightIntensity = calcLightIntensityAmbient();
//sum
float total = ambientLightIntensity;
return total;
}

View File

@ -21,6 +21,7 @@ uniform mat4 lightSpaceMatrix;
//output buffers
out vec3 Normal;
out vec3 FragPos;
out vec3 ViewFragPos;
out vec2 TexCoord;
out vec4 FragPosLightSpace;
@ -35,6 +36,7 @@ void main() {
//push frag, normal, and texture positions to fragment shader
FragPos = vec3(model * FinalVertex);
ViewFragPos = vec3(view * model * FinalVertex);
Normal = mat3(transpose(inverse(model))) * aNormal;
TexCoord = aTex;

View File

@ -85,15 +85,10 @@ in vec3 colorShiftValue;
uniform vec3 viewPos;
// uniform DirLight dirLight;
// uniform PointLight pointLights[NR_POINT_LIGHTS];
// uniform SpotLight spotLight;
uniform Material material;
//texture stuff
// uniform sampler2D ourTexture;
uniform int hasTransparency;
// uniform sampler2D specularTexture;
//light depth map
uniform sampler2D shadowMap;

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -16,14 +16,24 @@
+ feedback driven requirements
Item/Equip overhaul (again)
- Add punching/unarmed combat
- Implement gadgets
- Trap
- Bear
- Freeze
- Flame
- Bomb (to be thrown)
- Regular (Deals damage, ignites)
- Air (high push coeff)
- Flash (dazes)
- Sleep (puts enemies to sleep)
- Smoke (creates LOS blockers)
- Decoy (creates a decoy)
- Torch
- Throwable potions
Fix ui scaling on abnormal monitors
Better skybox
- Fix transparency calculations for far-out objects
Crouching
Model clothing, hair for the human
particles, light on sword collision
Looking angle leverages rotators to swing sword at angle (ie if you look up you swing your sword into the sky)
Come up with a title for the game and create a title menu for it (ideally with some animation and music)
Objectives
- PVP arena mode initially?
- Spawn player at start of a dungeon

View File

@ -841,6 +841,9 @@ Tree model debug menu
(09/24/2024)
Make voxel selection panel have better spacing
Partially fix idle animations for human + skeleton
Directional lighting color control
Skysphere affected by directional lighting
# TODO
@ -1012,6 +1015,12 @@ Weather tracking
- Keeps track at macro level of temperature
- Keeps track at macro level of precipitation
Environmental Audio Service
- Tracks characteristics about surroundings to determine looping audio to play
- Voxels nearby
- Major entity types nearby
- Biomes
Color Palette Generator

View File

@ -426,6 +426,45 @@ public class MenuGeneratorsLevelEditor {
}));
scrollable.addChild(zDiv);
Div rDiv = Div.createDiv();
rDiv.setMaxHeight(50);
rDiv.setFlexDirection(YogaFlexDirection.Row);
rDiv.addChild(Label.createLabel("R: "));
rDiv.addChild(Slider.createSlider((ValueChangeEvent event) -> {
LightManager lightManager = Globals.renderingEngine.getLightManager();
DirectionalLight directionalLight = lightManager.getDirectionalLight();
Vector3f color = directionalLight.getColor();
color.x = event.getAsFloat() * 2 - 1;
directionalLight.setColor(color);
}));
scrollable.addChild(rDiv);
Div gDiv = Div.createDiv();
gDiv.setMaxHeight(50);
gDiv.setFlexDirection(YogaFlexDirection.Row);
gDiv.addChild(Label.createLabel("G: "));
gDiv.addChild(Slider.createSlider((ValueChangeEvent event) -> {
LightManager lightManager = Globals.renderingEngine.getLightManager();
DirectionalLight directionalLight = lightManager.getDirectionalLight();
Vector3f color = directionalLight.getColor();
color.y = event.getAsFloat() * 2 - 1;
directionalLight.setColor(color);
}));
scrollable.addChild(gDiv);
Div bDiv = Div.createDiv();
bDiv.setMaxHeight(50);
bDiv.setFlexDirection(YogaFlexDirection.Row);
bDiv.addChild(Label.createLabel("B: "));
bDiv.addChild(Slider.createSlider((ValueChangeEvent event) -> {
LightManager lightManager = Globals.renderingEngine.getLightManager();
DirectionalLight directionalLight = lightManager.getDirectionalLight();
Vector3f color = directionalLight.getColor();
color.z = event.getAsFloat() * 2 - 1;
directionalLight.setColor(color);
}));
scrollable.addChild(bDiv);
Globals.signalSystem.post(SignalType.YOGA_APPLY,mainSidePanel);

View File

@ -23,7 +23,6 @@ public class Animation {
//common animations
public static final String ANIMATION_MOVEMENT_STARTUP = "WalkStart";
public static final String ANIMATION_MOVEMENT_MOVE = "Walk";
public static final String ANIMATION_IDLE_1 = "Idle1";
public static final String ANIMATION_SWING_PRIMARY = "SwingWeapon";
public static final String ANIMATION_SPRINT_STARTUP = "RunStart";
public static final String ANIMATION_SPRINT = "Run";

View File

@ -1,4 +1,4 @@
package electrosphere.menu;
package electrosphere.client.ui.menu;
import static org.junit.jupiter.api.Assertions.*;