Jump to content

SpiderPig

Members
  • Posts

    2,285
  • Joined

  • Last visited

Everything posted by SpiderPig

  1. Can I still sample a half float texture like this? vec4 color = texture(texture2DSampler[textureID], texcoords.xy); Or is there a different function for this? I don't know what the value of the vec4 would actually be...
  2. I want to save my heightmaps as R16 textures an use them for displacement and other things in shaders. Are these textures sampled any different to normal RGBA textures? Does the sample still return a vec4 with values in the range of 0 to 1?
  3. All six sides of the cuboid terrain are cast into their own heightmap so I can now do terrain erosion among other cool stuff. The six sided map is then used to create the voxel terrain. Here is the normal map turned into an atlas ready for the GPU.
  4. Wow cool stuff! I'm keen to hear the technical stuff on how you got it working. 😉
  5. Before starting the towns I had to fix a lot of core things with the voxel terrain. Now that I've done that I have also fixed a problem in the ray-casting of the SDF causing stepping in the heightmap and thus stepping in the normal map. Much nicer. I think it'd look better if the normal map was 4x bigger to give more detail, but I'll assess that after erosion maps and better texture placement are in use.
  6. Is it possible in Ultra to draw every entities AABB for debugging purposes? I'm sure I could make it myself but thought it worth checking first.
  7. Downloaded and tested and I do see memory increase when paused. Script memory goes up pretty fast. Confirmed with task manager open too. It's a few MB a minute. I wonder what it could be if @Alienhead did not see it on his machine.
  8. Breaking out the procedural town generator.
  9. Posted the issue here: https://www.ultraengine.com/community/topic/62056-shadow-problems/
  10. Okay, it's because it's far away from the origin. This test grid is 2048 vertically up, move around and you can see the dark shapes move with the camera. I wouldn't have thought this was far enough for floating point problems, but it may be related? #include "UltraEngine.h" using namespace UltraEngine; Vec3 mousepos = Vec3(0.0f); float move_adjustment = 0.1f; float move_speed = 1.0f; float lookspeed = 0.1f; float looksmoothing = 0.5f; 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(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); auto light = CreateDirectionalLight(world); light->SetRotation(35, 35, 0); auto box = CreateBox(world); box->SetPosition(10.0f, 2049.0f, 10.0f); auto custom_model = CreateModel(world); auto mesh = custom_model->AddMesh(); int size = 256, index = 0; for (int z = 0; z < size; z++) { for (int x = 0; x < size; x++) { mesh->AddVertex(x, 0.0f, z, 0.0f, 1.0f, 0.0f); if (x != 0 && x != size - 1 && z != 0 && z != size - 1) { mesh->AddPrimitive(index, index - size - 1, index - 1); mesh->AddPrimitive(index, index - size, index - size - 1); } index++; } } custom_model->UpdateBounds(); custom_model->SetPosition(0.0f, 2048.0f, 0.0f); camera->SetPosition(0.0f, 2048.0f, 0.0f); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F2) == true) { camera->SetWireframe(!camera->GetWireframe()); } auto _displaySize = window->GetSize(); float cx = Round((float)_displaySize.x / 2.0f); float cy = Round((float)_displaySize.y / 2.0f); auto mpos = Vec3(window->GetMousePosition().x, window->GetMousePosition().y, window->GetMousePosition().z); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); auto dx = (mpos.x - cx) * lookspeed; auto dy = (mpos.y - cy) * lookspeed; auto camrot = camera->GetRotation(); camrot.x += dy; camrot.y += dx; camera->SetRotation(camrot); mousepos = mpos; auto speed = 0.1f; if (window->KeyDown(KEY_SHIFT) == true) { speed = speed * 10.0f; } if (window->KeyDown(KEY_W) == true) {camera->Move(0, 0, speed);} else if (window->KeyDown(KEY_S) == true) { camera->Move(0, 0, -speed); } if (window->KeyDown(KEY_A) == true) { camera->Move(-speed, 0, 0); } else if (window->KeyDown(KEY_D) == true) { camera->Move(speed, 0, 0); } world->Update(); world->Render(framebuffer); } return 0; }
  11. Not my shader. This is the default shader....
  12. This is with IBL intensity set to 0. I'm sure I posted this issue before and I thought I solved it.. it might be my shader...
  13. Well if I actually created a light it might help, eh? void Atmosphere::CreateSun() { //light_sun = CreateDirectionalLight(world); //light_sun->SetRotation(45, 35, 0, true); } My dark patch friends are back with the light but no shadows. Shadows would need valid UV coords yeah?
  14. So this is it currently, not even shadows from the player. I'll double check my light setup first.
  15. That's what I originally thought but it never has... not for a custom mesh at least. Unless there's something extra I need to setup. Material or entity settings perhaps?
  16. Here's something I've never mastered. How to get my large voxel terrain to cast shadows onto itself? At the very least I want nearby mountains to cast shadows. Is this a separate pass done in a specific shader? Or some highly advanced custom code I need to write?
  17. Not 100% convinced the normal map has been generated correctly. But it's better than nothing. I think there is some stepping going on, but that's probably the height-map. I ended up using a sobel operator to calculate the normals.
  18. No subscription system any more. Hopefully released by the end of the year. You can look at the store for pre-order prices.
  19. Can Ultra track how much VRAM it is using as well as what's available? I was just playing Assassins Creed and it showed the total available and the total used by the game.
  20. Oooohhh. It all makes sense now. Thanks!
  21. Should it be converted back before using it?
×
×
  • Create New...