SpiderPig Posted March 22, 2023 Share Posted March 22, 2023 I've had no luck with this. When I add a geometry stage to the material family, it's fragment shader no longer works. The points seem to be showing the background color. I've got a simplified example here, it should move the verts a bit and they should be green. #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1440, 900, displays[0]); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); auto camera = CreateCamera(world); camera->Move(0, 2, 0); camera->SetClearColor(1, 0, 0); auto light = CreateDirectionalLight(world); light->SetColor(5.0f); light->SetRotation(35, 35, 35); auto floor = CreateBox(world, 100.0f, 0.5f, 100.0f); auto model = CreateModel(world); auto mesh = model->AddMesh(MESH_POINTS); for (int z = 0; z < 100; z++) { for (int x = 0; x < 100; x++) { mesh->AddVertex((float)x / 10.0f - 5.0f, 1.0f, (float)z / 10.0f); } } model->UpdateBounds(); model->SetMaterial(LoadMaterial("Materials\\Point.mat")); while (window->KeyHit(KEY_ESCAPE) == false && window->Closed() == false) { world->Update(); world->Render(framebuffer); } return 0; } Materials.zip Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted March 22, 2023 Solution Share Posted March 22, 2023 Question: Do you have a matching depth pass shader you are using for the depth pre-pass? You can disable camera depth pre-pass to test this. 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...
SpiderPig Posted March 22, 2023 Author Share Posted March 22, 2023 Ah yes that is the problem. Where does that go in the shader family JSON? { "shaderFamily": { "root": "Shaders/PBR.json", "static": { "float": { "OPAQUE": { "default": { "base": { "geometry": "Materials/Point.geom.spv", "fragment": "Materials/Point.frag.spv" } } }, "MASK": { "default": { "base": { } } } }, "double": { "OPAQUE": { "default": { "base": { } } }, "MASK": { "default": { "base": { } } } } } } } Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted March 22, 2023 Author Share Posted March 22, 2023 I have found it. "OPAQUE": { "default": { "base": { "geometry": "Materials/Point.geom.spv", "fragment": "Materials/Point.frag.spv" }, "depthPass": { "geometry": "Materials/Point.geom.spv" } } } Quote 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.