Better Studs
This commit is contained in:
parent
9b06763cfb
commit
a36407c75e
7 changed files with 15 additions and 3 deletions
Binary file not shown.
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 19 KiB |
BIN
assets/textures/studs.psd
Normal file
BIN
assets/textures/studs.psd
Normal file
Binary file not shown.
BIN
assets/textures/studs.xcf
Normal file
BIN
assets/textures/studs.xcf
Normal file
Binary file not shown.
BIN
assets/textures/studs1.png
Normal file
BIN
assets/textures/studs1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
assets/textures/studs_beta.png
Normal file
BIN
assets/textures/studs_beta.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
|
@ -15,6 +15,7 @@
|
||||||
#include "../camera.h"
|
#include "../camera.h"
|
||||||
#include "../part.h"
|
#include "../part.h"
|
||||||
#include "skybox.h"
|
#include "skybox.h"
|
||||||
|
#include "surface.h"
|
||||||
#include "texture3d.h"
|
#include "texture3d.h"
|
||||||
|
|
||||||
#include "renderer.h"
|
#include "renderer.h"
|
||||||
|
@ -46,7 +47,7 @@ void renderInit(GLFWwindow* window) {
|
||||||
"assets/textures/skybox/null_plainsky512_bk.jpg",
|
"assets/textures/skybox/null_plainsky512_bk.jpg",
|
||||||
}, GL_RGB);
|
}, GL_RGB);
|
||||||
|
|
||||||
studsTexture = new Texture3D("assets/textures/studs.png", 64, 64, 6, GL_RGBA);
|
studsTexture = new Texture3D("assets/textures/studs.png", 128, 128, 6, GL_RGBA);
|
||||||
|
|
||||||
// Compile shader
|
// Compile shader
|
||||||
shader = new Shader("assets/shaders/phong.vs", "assets/shaders/phong.fs");
|
shader = new Shader("assets/shaders/phong.vs", "assets/shaders/phong.fs");
|
||||||
|
@ -90,8 +91,9 @@ void renderParts() {
|
||||||
// });
|
// });
|
||||||
studsTexture->activate(0);
|
studsTexture->activate(0);
|
||||||
shader->set("studs", 0);
|
shader->set("studs", 0);
|
||||||
shader->set("surfaces[1]", 3);
|
// shader->set("surfaces[1]", SurfaceStuds);
|
||||||
shader->set("surfaces[4]", 4);
|
shader->set("surfaces[1]", SurfaceStuds);
|
||||||
|
shader->set("surfaces[4]", SurfaceInlets);
|
||||||
|
|
||||||
// Pre-calculate the normal matrix for the shader
|
// Pre-calculate the normal matrix for the shader
|
||||||
|
|
||||||
|
|
10
src/rendering/surface.h
Normal file
10
src/rendering/surface.h
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
enum SurfaceType {
|
||||||
|
SurfaceSmooth = 0,
|
||||||
|
SurfaceGlue = 1,
|
||||||
|
SurfaceWeld = 2,
|
||||||
|
SurfaceStuds = 3,
|
||||||
|
SurfaceInlets = 4,
|
||||||
|
SurfaceUniversal = 5,
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue