Skip to content

Commit

Permalink
Added skybox and skydomes
Browse files Browse the repository at this point in the history
  • Loading branch information
Borf committed Jan 26, 2023
1 parent d3474a6 commit a3b2d3d
Show file tree
Hide file tree
Showing 7 changed files with 5,561 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ bugreports
patch_run
Patcher/x64
data/texture/effect
data/texture/skyboxes
backups
3,009 changes: 3,007 additions & 2 deletions browedit/MapView.cpp

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions browedit/MapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ class MapView
public:
virtual void buildVertices(std::vector<VertexP3T2N3>& verts) override;
};

class SkyBoxMesh : public Mesh
{
public:
virtual void buildVertices(std::vector<VertexP3T2N3>& verts) override;
};
class SkyDomeMesh : public Mesh
{
public:
virtual void buildVertices(std::vector<VertexP3T2N3>& verts) override;
};

public:
Map* map = nullptr;
int id;
Expand All @@ -56,6 +68,12 @@ class MapView
SimpleShader* simpleShader = nullptr;
static inline SphereMesh sphereMesh;
static inline CubeMesh cubeMesh;
static inline SkyBoxMesh skyBoxMesh;
static inline SkyDomeMesh skyDomeMesh;
static inline std::vector<gl::Texture*> skyTextures;
static inline gl::Texture* skyTexture;
bool skyboxCube = false;
float skyboxHeight = 0;
static inline gl::Texture* cubeTexture = nullptr;
gl::Texture* whiteTexture;

Expand Down
Binary file added data/model/sky.blend
Binary file not shown.
46 changes: 46 additions & 0 deletions data/model/skybox.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Blender 3.4.1
# www.blender.org
mtllib skybox.mtl
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vt 0.500000 0.666667
vt 0.500000 0.333333
vt 0.250000 0.666667
vt 0.250000 0.333333
vt 0.500000 1.000000
vt 0.750000 0.666667
vt 0.500000 0.000000
vt 0.750000 0.333333
vt 0.250000 1.000000
vt 0.000000 0.666667
vt 1.000000 0.666667
vt 1.000000 0.333333
vt 0.000000 0.333333
vt 0.250000 0.000000
s 0
usemtl Material
f 5/5/1 3/3/1 1/1/1
f 3/3/2 8/13/2 4/4/2
f 7/11/3 6/8/3 8/12/3
f 2/2/4 8/14/4 6/7/4
f 1/1/5 4/4/5 2/2/5
f 5/6/6 2/2/6 6/8/6
f 5/5/1 7/9/1 3/3/1
f 3/3/2 7/10/2 8/13/2
f 7/11/3 5/6/3 6/8/3
f 2/2/4 4/4/4 8/14/4
f 1/1/5 3/3/5 4/4/5
f 5/6/6 1/1/6 2/2/6
Loading

0 comments on commit a3b2d3d

Please sign in to comment.