Jump to content

Josh

Staff
  • Posts

    27033
  • Joined

  • Last visited

About Josh

Profile Information

  • Location
    USA

Recent Profile Visitors

1532619 profile views

Josh's Achievements

Grand Master

Grand Master (14/14)

  • Well Followed
  • Dedicated
  • Conversation Starter
  • Reacting Well
  • Problem Solver

Recent Badges

17.3k

Reputation

1.3k

Community Answers

  1. I have been experiencing the same thing. Must be something related to the website migration...
  2. Another report here with a 580:
  3. Already reported here, with almost the same card:
  4. What graphics card do you have?
  5. The article here has more complete instructions:
  6. Josh

    Bug Ilumination

    Thank you. With this information I am now able to produce the error. There is probably still a bug(?), but now we know the cause: #include "Leadwerks.h" namespace lwe = Leadwerks; int main(int argc, const char* argv[]) { auto displays = lwe::GetDisplays(); auto window = lwe::CreateWindow("", 0, 0, 1280, 720, displays[0], lwe::WINDOW_DEFAULT); auto framebuffer = lwe::CreateFramebuffer(window); auto world = lwe::CreateWorld(); world->SetAmbientLight(0); auto camera = lwe::CreateCamera(world); camera->Move(0, 2, -4); camera->SetClearColor(0.125f); auto floor = CreateBox(world, 20, 1, 20); auto box = CreateBox(world); box->SetPosition(0, 2, 0); box->Staticize(); auto child = CreateBox(world); child->SetParent(box); child->SetPosition(1, 0, 0); auto light = CreatePointLight(world); light->SetPosition(0, 4, 0); light->SetRange(10); while (window->Closed() == false && window->KeyDown(lwe::KEY_ESCAPE) == false) { if (window->KeyDown(Leadwerks::KEY_SPACE)) child->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; }
  7. Tested an R9 280 with last driver 22.6.1, and outlines worked fine, although lighting did not. I would need to buy an AMD RX 570 to find out what the problem is.
  8. Okay, will test it out this week.
  9. Josh

    Bug Ilumination

    I tried to replicate this situation, thinking that the fact the door is a child of another entity might be the problem, but I was not able to produce the error. If you select the door in the editor, right-click on its node in the scene tree, and select "Unlink Prefab" to convert it into a regular entity, does the error still occur when you run the game after that? #include "Leadwerks.h" namespace lwe = Leadwerks; int main(int argc, const char* argv[]) { auto displays = lwe::GetDisplays(); auto window = lwe::CreateWindow("", 0, 0, 1280, 720, displays[0], lwe::WINDOW_DEFAULT); auto framebuffer = lwe::CreateFramebuffer(window); auto world = lwe::CreateWorld(); world->SetAmbientLight(0); auto camera = lwe::CreateCamera(world); camera->Move(0, 2, -4); camera->SetClearColor(0.125f); auto floor = CreateBox(world, 20, 1, 20); auto box = CreateBox(world); box->SetPosition(0, 2, 0); auto child = CreateBox(world); child->SetParent(box); child->SetPosition(1, 0, 0); auto light = CreatePointLight(world); light->SetPosition(0, 4, 0); light->SetRange(10); while (window->Closed() == false && window->KeyDown(lwe::KEY_ESCAPE) == false) { if (window->KeyDown(Leadwerks::KEY_SPACE)) child->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; }
  10. Josh

    Bug Ilumination

    It looks like the door moving does not trigger the light to refresh its shadow. I don't know why. The moment the animated character walks back into the light volume, the shadow refreshes.
  11. In this situation, you probably would not want prefabs, since each of these things is unique. This is when it is convenient to convert a prefab into a regular entity, by right-clicking on the object and selecting "Unlink Prefab".
  12. I would like to test your project. Can you please send this to me?
  13. Is this still occurring in the current version? I have not tested on my 580 yet, but what that actually looks like is maybe the shader was reading a sampler2DMS texture as a sampler2D.
  14. It looks like the orientation here is correct. In OpenGL, screen coordinates (0, 0) are in the lower-left corner. But texture coordinates point down in the positive direction. #include "Leadwerks.h" namespace lwe = Leadwerks; int main(int argc, const char* argv[]) { auto displays = lwe::GetDisplays(); auto window = lwe::CreateWindow("gl_FragCoord", 0, 0, 720, 720, displays[0], lwe::WINDOW_DEFAULT); auto framebuffer = lwe::CreateFramebuffer(window); auto world = lwe::CreateWorld(); auto light = lwe::CreateDirectionalLight(world); auto cone_0 = lwe::CreateCone(world, 0.5f, 1.f, 64); auto cube_f = lwe::CreateBox(world); cube_f->SetScale(100.f, 1.f, 100.f); cube_f->SetPosition(0.f, -3.001f, 0.f); cone_0->SetPosition(0.0f, +1.f, +2.f); light->SetRotation(60, 0, 0); light->SetColor(0.5f); world->SetAmbientLight(0.1f, 0.1f, 0.1f); auto camera_0 = lwe::CreateCamera(world); auto camera_1 = lwe::CreateCamera(world); auto camera_0_texture_0 = lwe::CreateTexture(lwe::TEXTURE_2D, 720, 720); auto camera_0_texbuff = lwe::CreateTextureBuffer(720, 720, 1, true); camera_0_texbuff->SetColorAttachment(camera_0_texture_0, 0); camera_0->SetRenderTarget(camera_0_texbuff); camera_0->SetOrder(0); /* camera_1->SetLighting(false); camera_1->SetRenderLayers(0); camera_1->SetOrder(1); auto camera_1_effect = lwe::LoadPostEffect("Effects/BaseColor.fx"); auto camera_1_effect_id = camera_1->AddPostEffect(camera_1_effect); camera_1->EnablePostEffect(camera_1_effect_id); camera_1->SetUniform(camera_1_effect_id, "ColorBuffer", camera_0_texture_0); */ auto texturebuff_rt = lwe::CreateTextureBuffer(2, 2, 1, false); auto framebuffer_rt = nullptr; auto box = CreateBox(world); box->SetPosition(0, 0, 3); auto mtl = lwe::CreateMaterial(); mtl->SetTexture(camera_0_texture_0); // Uncomment to verify the box UV mapping is correct: //mtl->SetTexture(lwe::LoadTexture("https://leadwerksstorage.s3.us-east-2.amazonaws.com/monthly_2026_02/test.png.d230cd11a6904ef36c91256aa96b243d.png")); box->SetMaterial(mtl); // Let's make sure the position V axis points down on the texcoords for (int v = 0; v < box->lods[0]->meshes[0]->CountVertices(); ++v) { auto pos = box->lods[0]->meshes[0]->vertices[v].position; auto tc = box->lods[0]->meshes[0]->vertices[v].texcoords.xy(); tc.y = 1.0f - (pos.y + 0.5f); box->lods[0]->meshes[0]->SetVertexTexCoords(v, tc); } while (window->Closed() == false && window->KeyDown(lwe::KEY_ESCAPE) == false) { #if 1 if (window->KeyHit(lwe::KEY_D1)) { // Output to framebuffer from camera_1 (post effect Shaders/BaseColor.fx) //camera_0->SetRenderTarget(camera_0_texbuff); //camera_1->SetRenderTarget(framebuffer_rt); } if (window->KeyHit(lwe::KEY_D2)) { // Output to framebuffer from camera_0 (post effect is ignored) //camera_0->SetRenderTarget(framebuffer_rt); //camera_1->SetRenderTarget(texturebuff_rt); } #endif box->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; } You can see here that render-to-texture has the correct orientation. THere's a line you can uncomment to load a different texture to verify the UV mapping of the box.
×
×
  • Create New...