SpiderPig Posted July 14, 2023 Share Posted July 14, 2023 Here's a quick program and shader to test this out. The shader works with inTexCoords.xy but not with inTexCoords.zw. #include "UltraEngine.h" #include "Components/Mover.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto box = CreatePlane(world); box->SetRotation(-90.0f, 0.0f, 0.0f); auto material = LoadMaterial("Materials\\Test.mat"); box->SetMaterial(material); auto mesh = box->lods[0]->meshes[0]; mesh->SetVertexTexCoords(0, 0.0f, 0.0f, 1); mesh->SetVertexTexCoords(1, 1.0f, 0.0f, 1); mesh->SetVertexTexCoords(2, 0.0f, 1.0f, 1); mesh->SetVertexTexCoords(3, 1.0f, 1.0f, 1); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Shader : #version 450 #extension GL_GOOGLE_include_directive : enable #extension GL_ARB_separate_shader_objects : enable #extension GL_EXT_multiview : enable #include "../../../../../../../../UltraEngine/Templates/Common/Shaders/Base/TextureArrays.glsl" #include "../../../../../../../../UltraEngine/Templates/Common/Shaders/Base/Materials.glsl" layout(location = 5 ) in flat uint inMaterialIndex; layout(location = 2 ) in vec4 inTexCoords; layout(location = 0) out vec4 color[8]; void main() { color[0] = texture( texture2DSampler[ GetMaterialTextureHandle( materials[ inMaterialIndex ] , 0 ) ] , inTexCoords.zw ); } Files : Shaders.zip Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted July 17, 2023 Author Share Posted July 17, 2023 Hey @Josh do you think this is a bug or is it just my bad shader skills? Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted July 18, 2023 Solution Share Posted July 18, 2023 The second UV set was not being copied into the mesh data. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.