Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Jun 14, 2024
1 parent 59c1d3f commit af1dfb2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ uniform vec2 mouse;
uniform samplerCube skybox;

void main(){



float rotX = (time / resolution.x) * -20.0 * 3.14;
float rotY = (resolution.y/2 / resolution.y) * 3.14;

Expand All @@ -23,6 +24,10 @@ void main(){
vec3 camU = cross(camR,camD);

vec3 dir = normalize(-uv.x * camR + uv.y * camU + camD);




gl_FragColor = texture(skybox, dir);

}
File renamed without changes.
7 changes: 4 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"geode": "3.0.0-alpha.2",
"geode": "3.0.0-beta.1",
"gd": {
"win": "2.206"
},
"version": "v0.6.3",
"version": "v0.6.4",
"id": "zalphalaneous.minecraft",
"name": "Minecraftify!",
"developer": "Alphalaneous",
Expand All @@ -17,7 +17,8 @@
"assets/textures/*",
"assets/texts/*",
"assets/panorama/*",
"assets/shaders/*",
"assets/shaders/cubemap/*",
"assets/shaders/blur/*",
"assets/logo.ico"
]
},
Expand Down
1 change: 1 addition & 0 deletions src/ui/hooks/MenuLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class $modify(MyMenuLayer, MenuLayer) {

Panorama* panorama = Panorama::create();
panorama->setID("minecraft-panorama"_spr);

this->addChild(panorama);

this->getChildByIDRecursive("main-menu")->setVisible(false);
Expand Down
7 changes: 3 additions & 4 deletions src/ui/nodes/Panorama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../../utils/Utils.h"

Panorama* Panorama::create(){
auto node = new Panorama;
auto node = new Panorama();
if (!node->init()) {
CC_SAFE_DELETE(node);
return nullptr;
Expand All @@ -13,14 +13,13 @@ Panorama* Panorama::create(){
}

bool Panorama::init(){
std::filesystem::path vertexPath = (std::string)CCFileUtils::sharedFileUtils()->fullPathForFilename("vertex.glsl"_spr, false);
std::filesystem::path fragmentPath = (std::string)CCFileUtils::sharedFileUtils()->fullPathForFilename("fragment.glsl"_spr, false);
std::filesystem::path vertexPath = CCFileUtils::sharedFileUtils()->fullPathForFilename("cubemap_vert.glsl"_spr, false);
std::filesystem::path fragmentPath = CCFileUtils::sharedFileUtils()->fullPathForFilename("cubemap_frag.glsl"_spr, false);

auto vertexSource = file::readString(vertexPath);
auto fragmentSource = file::readString(fragmentPath);

m_shader.setup(vertexSource.unwrap(), fragmentSource.unwrap());

glBindAttribLocation(m_shader.program, 0, "aPosition");

ccGLUseProgram(m_shader.program);
Expand Down

0 comments on commit af1dfb2

Please sign in to comment.