Jump to content

Thirsty Panther

Developers
  • Posts

    1,275
  • Joined

  • Last visited

Everything posted by Thirsty Panther

  1. Rick explains his script in this post. Aiaf also explains how to set up a Load/Save script in this post. It also has other links inside to other discussions about loading and saving.
  2. And while we are at it could we have someway of setting the game camera to the editor cameras position.
  3. What's the idea with bringing in the bottom four points?
  4. Try this. https://www.shadertoy.com/view/wtVSDh
  5. Nice work. Love to see the finished product. Here is a link to the pack that Alien used for those interested.
  6. #include "UltraEngine.h" #include "ComponentSystem.h" #include "PerlinNoise.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the display list auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Terrain Experiment", 0, 0, 1920, 1080, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); world->SetAmbientLight(0); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetFov(70); camera->SetPosition(0, 50, 0); camera->SetRotation(45, 0, 0); camera->SetClearColor(0.125); //Sunlight auto light = CreateDirectionalLight(world); light->SetRotation(45, 35, 0); light->SetColor(1); //Set environment maps const WString remotepath = "https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets"; auto specmap = LoadTexture(remotepath + "/Materials/Environment/Storm/specular.dds"); auto diffmap = LoadTexture(remotepath + "/Materials/Environment/Storm/diffuse.dds"); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_BACKGROUND); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE); auto mtl = CreateMaterial(); mtl->SetRoughness(0.25); mtl->SetMetalness(0.5); auto ball = CreateSphere(world); ball->SetMaterial(mtl); //Create terrain from noise map auto terrain = CreateTerrain(world, 512); terrain->SetScale(1, 100, 1); const siv::PerlinNoise::seed_type seed = 656621u; const siv::PerlinNoise perlin{ seed }; //Create base material auto ground = CreateMaterial(); auto diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_diff_4k.dds"); auto normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_nor_gl_4k.dds"); ground->SetTexture(diffusemap, TEXTURE_DIFFUSE); ground->SetTexture(normalmap, TEXTURE_NORMAL); terrain->SetMaterial(ground); //Create ground rocks material auto rocks = CreateMaterial(); diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k.dds"); normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_dot3.dds"); auto dispmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_disp.dds"); rocks->SetTexture(diffusemap, TEXTURE_DIFFUSE); rocks->SetTexture(normalmap, TEXTURE_NORMAL); rocks->SetTexture(dispmap, TEXTURE_DISPLACEMENT); //Create grass material auto grass = CreateMaterial(); diffusemap = LoadTexture("Materials/Grass01_albedo.dds"); normalmap = LoadTexture("Materials/Grass01_normal.dds"); dispmap = LoadTexture("Materials/Grass01_height.dds"); grass->SetTexture(diffusemap, TEXTURE_DIFFUSE); grass->SetTexture(normalmap, TEXTURE_NORMAL); grass->SetTexture(dispmap, TEXTURE_DISPLACEMENT); //Create cliff rocks material auto cliff = CreateMaterial(); diffusemap = LoadTexture("Materials/Rock_Cliff_albedo.dds"); normalmap = LoadTexture("Materials/Rock_Cliff_A_normal.dds"); dispmap = LoadTexture("Materials/Rock_Cliff_height.dds"); cliff->SetTexture(diffusemap, TEXTURE_DIFFUSE); cliff->SetTexture(normalmap, TEXTURE_NORMAL); cliff->SetTexture(dispmap, TEXTURE_DISPLACEMENT); //Create snow material auto snow = CreateMaterial(); diffusemap = LoadTexture("Materials/Snow_albedo.dds"); normalmap = LoadTexture("Materials/Snow_normal.dds"); dispmap = LoadTexture("Materials/Snow_height.dds"); snow->SetTexture(diffusemap, TEXTURE_DIFFUSE); snow->SetTexture(normalmap, TEXTURE_NORMAL); snow->SetTexture(dispmap, TEXTURE_DISPLACEMENT); // Apply material based on noise function output for (int x = 0; x < terrain->resolution.x; ++x) { for (int y = 0; y < terrain->resolution.y; ++y) { // Sample noise function at this point of the terrain const double noise = perlin.normalizedOctave2D((x * 0.01), (y * 0.01), 5); terrain->SetElevation(x, y, noise * 100); float slope = abs(terrain->GetSlope(x, y)); if (slope < 5) { terrain->SetMaterial(x, y, grass, 0.6f); } else if (slope>5 && slope < 10) { terrain->SetMaterial(x, y, rocks, 0.6f); } else if (slope >10 && slope < 40) { terrain->SetMaterial(x, y, cliff, 0.6f); } else { terrain->SetMaterial(x, y, snow, 0.6f); } } } //Camera controls auto actor = CreateActor(camera); actor->AddComponent<CameraControls>(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } This is my full code. I use Ryo Suzuki Perlin Noise library from here. My textures Textures.zip from Textures.com. The other assets are from UltrEngine Github.
  7. Update: I thought I found the problem. I simplified my program to only one texture. I went through each one of my 5 textures until I found that RockCiff_A is not the same as Rock_Cliff_A. Eureka! problem solved. Unfortunately not, I added all the textures back in and the problem persisted. Further investigation led me to suspect the weighting I was giving each material was the cause of the problem. Here is my code. for (int x = 0; x < terrain->resolution.x; ++x) { for (int y = 0; y < terrain->resolution.y; ++y) { // Sample noise function at this point of the terrain const double noise = perlin.normalizedOctave2D((x * 0.01), (y * 0.01), 5); terrain->SetElevation(x, y, noise * 100); float slope = abs(terrain->GetSlope(x, y)); if (slope < 5) { terrain->SetMaterial(x, y, grass, 0.7f); } else if (slope>5 && slope < 10) { terrain->SetMaterial(x, y, rocks, 0.7f); } else if (slope >10 && slope < 40) { terrain->SetMaterial(x, y, cliff, 0.7f); } else { terrain->SetMaterial(x, y, snow, 0.7f); } } If the weight is 0.6f or less then no problem. Once you go over 0.65f then the artifact returns. I don't fully understand how the weighting works.
  8. Enabling tessellation didn't fix the problem. I used camera->SetTessellation(4); as shown in the example in the documentation. This only made my camera movement jerky. The Camera clear color is set to 0.125. Changing this made no difference. The background is the Storm skybox from the Github. I commented this out and made no difference. I think the problem may lie in my textures.
  9. Not sure if its the background. It only appears where the flat ground meets a mountain. The rest of the terrain is fine. I don't think I have tessellation enabled. I will check this out today. My graphics card: Nvidia GeForce GTX 1060.
  10. Getting gaps in my terrain textures.
  11. Can the preview window play audio files? Would be very handy if it could.
  12. I found version 1.1 on my computer. It's pretty old and I don't know if it still works. FlowGUI_1.1.zip
  13. I've been using this to help with my C++ coding. I can see this is going to be a big challenge for education institutions. It will be a scare for Google. Why search thru lots of search results when you can get the answer directly. AI has certainly come a long way this year.
  14. Hey Josh you might want to check your EULA. Paragraph 7 looks like it has a typo. Yeah I know, I'm board.
  15. Are you going to seperate the old Leadwerks content from the new Ultra Engine content ? It would avoid a lot of confusion moving forward.
  16. I already have a job, I just want a new Game Engine
  17. There one in the Workshop by Ocelot. It's a little old but may at least get you a started.
  18. The Test works fine on my Intel i7 with GeForce GTX 1060.
  19. I think he means this https://store.steampowered.com/app/622650/Bendy_and_the_Ink_Machine/
  20. Most of what I have learnt about Leadwerks has been from the good people on this forum. I repay their kindness by helping others.
  21. Setinput should solve your problems. https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_SetInput
  22. Leadwerks could load FBX models, is that possible with Ultra or will we need a plugin? Will Leadwerks scripts work in Ultra? Are we close to a release of Ultra? Thanks.
  23. Sorry I can't help myself. You don't need a crane in space . The asteroid wouldn't have enough gravitational pull to attract the container. It would just float. Okay I feel better now that I have got that off my chest.
×
×
  • Create New...