Jump to content

SpiderPig

Members
  • Posts

    2,285
  • Joined

  • Last visited

Everything posted by SpiderPig

  1. I did a clean install of the latest update, I have the new client too. Clicking a project loads the editor in the task bar but it does not display. Hovering over the icon will show that it is a white window but there is no window visible. Loading it directly from Editor.exe does this too. The UltraEngine splash is also way off centre for me. I had these issues with the last version too. I had the assets editors working for a bit then they did the same thing, loaded into the taskbar but showed no window and was white on the preview.
  2. Thought I'd show off my node editor for Ultra Engine Shaders. Currently I'm developing it as I develop my game, so features get added as I need them. But I'd love to hear your feedback and if you'd like me to add something I'm sure I can oblige. Discord for ShaderMaster ShaderMaster_v1.3.zip Before use, you need to set the path to UltraEngine like this so it can find the tools and shaders. You will also need to copy 'FragmentCustom.glsl' to 'UltraEngine\Templates\Common\Source\Shaders\PBR' in order to use the fragment shader nodes. Then to create a new project go to File->New Project and enter in a name. PBR is the only available at the moment and you can choose PostEffect from the right drop down - but this has not been tested in some time! Feel free to explore it though. Add a file to the project by clicking the file icon with the '+'. Below are the files associated with one of my projects. Macros are also visible when the checkbox is checked. Macros are functions that can be used between projects. Create a function, right click the function file and choose 'Convert to Macro'. The function will be removed the current project and added to the macro folder. Choose a file type, this is either a shader stage or a function or definition. I've used the fragment shader extensively. I have used the vertex and geometry shaders though there may be bugs here. Please let me know. Tessellation and Compute stages aren't working yet. Select a file from the list on the right to open it and right click in the node area to get a menu of all the available nodes. I'll make in depth tutorials on this later if any one is interested as there's a lot more to cover. Right now it's there to play with. An example of the fragment shader for my voxel terrain.
  3. And the answer is : #include "../../../../../../../../UltraEngine/Templates/Common/Shaders\Base\Materials.glsl" Relatively speaking.
  4. I wanted to try and compile some shaders in a location away from the validator and the .glsl files. It compiles fine so long as I don't try to include anything in the shader. The BAT file; C:\UltraEngine\Tools\glslangValidator.exe "C:\_output\Test.frag" -V -o "C:\_output\Test.frag.spv" The Shader; #version 450 #extension GL_GOOGLE_include_directive : enable #extension GL_ARB_separate_shader_objects : enable #extension GL_EXT_multiview : enable //Compiles if this line is commented out #include "C:\UltraEngine\Templates\Common\Shaders\Base\Materials.glsl" layout(location = 0) out vec4 outColor; void main() { outColor = vec4(0.0f, 1.0f, 1.0f, 1.0f); } Does the validator only use relative paths somhow?
  5. I have found it. "OPAQUE": { "default": { "base": { "geometry": "Materials/Point.geom.spv", "fragment": "Materials/Point.frag.spv" }, "depthPass": { "geometry": "Materials/Point.geom.spv" } } }
  6. 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": { } } } } } } }
  7. 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
  8. I deleted a few faces and remade them but still the same result. There are no double vertices and they appear to be correctly connected.
  9. This is just perplexing. The one on the left was made in blender, the right was exported from marching cubes. Both have flat shading. The left has a few more faces and vertices on the bevel, but, why the odd shading around the triangles on the right? TestCube.zip VoxelTerrain.zip
  10. I noticed this a while ago just briefly. Text area works but text field is not visible. The project is up to date. #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, -3); camera->SetClearColor(1, 0, 0); auto light = CreateDirectionalLight(world); light->SetRotation(35, 35, 35); auto floor = CreateBox(world, 100.0f, 0.5f, 100.0f); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->size); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->size.x * 0.5f, (float)framebuffer->size.y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); //auto text = CreateTextArea(0, 0, 512, 30, ui->root); auto text = CreateTextField(0, 0, 512, 30, ui->root); text->SetText("Hello Ultra"); while (window->KeyHit(KEY_ESCAPE) == false && window->Closed() == false) { while (PeekEvent()) { ui->ProcessEvent(WaitEvent()); } world->Update(); world->Render(framebuffer); } return 0; }
  11. Yeah that's a good idea. I briefly looked at getting normals from an SDF in a shader. I think it's just a few extra samples in some known directions... I will try this.
  12. I saw here I might need to do a better job at averaging the normals of shared vertices. It says to use the angle to determine the weight that each face's normal will effect the vertex. I tried with the dot product and seemed to get slightly better results but I'm unsure on exactly what the value of "Angle" in this answers code should be. Degrees maybe? or just 0 to 1? Is there a "proper" method of average normals for shared vertices? Usually I just add all the faces normals up that share the vertex and divided by total number of faces that share it. Might be half my problem.
  13. Thanks I had no idea it could be done that easily in GIMP.
  14. I agree, its a bit messy. I could merge vertices in a 2nd pass but I think it'll be a bit slow - or maybe it could be done in one pass as I create the vertices... but Surface Nets should make better geometry because the vertices should be relative evenly spaced, and there will be less triangles too. I'm working on it now so should have some results soon.
  15. I'll admit, once there are textures applied its not too bad. I still think it could be better though.
  16. Found this. The normals here don't look too amazing. I think they're smooth shading, kind of looks like it. https://www.youtube.com/watch?v=pI61q7q-2HE
  17. Love the Model::Save() method. In blender I confirmed there is no double up on verts, all triangles are sharing what they should be. These are the exported normals. Using blender to recalculate smooth shading gave no visual difference. I thought they should look better than this? Maybe this is another pitfall of marching cubes. Too many small thin triangles!
  18. I've decided I will write a method that saves a voxel terrains component as a mesh so I can do some more testing on it in a separate program. I'll upload some results and hopefully find what I'm doing wrong.
  19. Getting some mixed results with this. There are no double vertices in the mesh any more (99.9% sure ) and this is with model->UpdateNormals(). This is the result. I've outlined the wireframe with red. It seems that if the triangles are really small it gives sharp results.
  20. Fixed a few issues. I was only allocating enough voxel memory pages for the final level of subdivision that represented the surface. I didn't take into account the fact that I needed space for the all their parent nodes too. Also have finally removed double vertices with the TransVoxel method. In one scene there was 108k vertices, after the fix it went down to 30k. About a 72% decrease!
  21. This is a 2k Voxel Terrain with tri-planer texturing. It's just diffuse right now, and the red is an area that will be textured differently. It's coming along nicely. I think I'll work on normal maps and smooth shading. The LOD algorithm needs work, the detail in the terrain falls off too sharply I feel.
  22. Issues disappears when I delete the directional light.
  23. I wonder if it's too much to ask for a temporary solution for this? Just the ability to get the index the material is stored in the shader is enough, I can do the rest and send it to my shader. I'd like to get a nice material up and running for the voxel terrain. I'm just guessing at what the material index is in the shader. It changes though as the game grows though.
×
×
  • Create New...