Jump to content

Josh

Staff
  • Content Count

    16,917
  • Joined

  • Last visited

Blog Comments posted by Josh

  1. 44 minutes ago, Cromartie said:

    I hope that the release of LE 5 on Steam will not be postponed.

    It means I am not pushing to do a crowdfunding campaign before November. It could actually mean an earlier release date because I don’t have to deal with all the logistics of the conference and its aftermath. I was expecting to not really get anything done between now and January but I guess now there will be more time to code.

    • Like 2
    • Thanks 1
  2. 6 minutes ago, Mickey said:

    Can you make voxel based terrains / planets  like in games "Space Engineers" or "7 Days to Die"  or "Empyrion - Galactic Survival" ?

    It would require another system for voxel terrain. This is meant for displaying GIS data.

  3. It looks like 1024 is WAY too big for the patch size, because it makes the terrain chunks so large that LOD is impractical. I am switching it to 256. Here is some code that lets you easily change the parameters:

        const int terrainsize = 32768;
        const int patchsize = 64;
        const std::string heightmapfile = "32768.r16";
    
        auto stream = ReadFile(heightmapfile);
        auto buffer = CreateStreamBuffer(stream, 0, stream->GetSize());
        auto pixmap = CreatePixmap(terrainsize, terrainsize, TEXTURE_R16, buffer);
    
        auto dest = CreatePixmap(patchsize, patchsize, TEXTURE_R16);
    
        CreateDir("Terrain/32768/LOD0");
        for (int x = 0; x < pixmap->size.x / patchsize; ++x)
        {
            for (int y = 0; y < pixmap->size.y / patchsize; ++y)
            {
                pixmap->CopyRect(x * patchsize, y * patchsize, patchsize, patchsize, dest, 0, 0);
                dest->Save("Terrain/32768/LOD0/" + String(x) + "_" + String(y) + ".dds");
            }
        }
    
        int num = terrainsize / patchsize;
        int lod = 0;
    
        while (num > 0)
        {
            CreateDir("Terrain/32768/LOD" + String(lod + 1));
            for (int x = 0; x < num / 2; ++x)
            {
                for (int y = 0; y < num / 2; ++y)
                {
                    auto pm00 = LoadPixmap("Terrain/32768/LOD" + String(lod) + "/" + String(x * 2 + 0) + "_" + String(y * 2 + 0) + ".dds");
                    auto pm10 = LoadPixmap("Terrain/32768/LOD" + String(lod) + "/" + String(x * 2 + 1) + "_" + String(y * 2 + 0) + ".dds");
                    auto pm01 = LoadPixmap("Terrain/32768/LOD" + String(lod) + "/" + String(x * 2 + 0) + "_" + String(y * 2 + 1) + ".dds");
                    auto pm11 = LoadPixmap("Terrain/32768/LOD" + String(lod) + "/" + String(x * 2 + 1) + "_" + String(y * 2 + 1) + ".dds");
                    pm00 = pm00->Resize(patchsize/2, patchsize / 2);
                    pm10 = pm10->Resize(patchsize / 2, patchsize / 2);
                    pm01 = pm01->Resize(patchsize / 2, patchsize / 2);
                    pm11 = pm11->Resize(patchsize / 2, patchsize / 2);
                    pm00->CopyRect(0, 0, patchsize / 2, patchsize / 2, dest, 0, 0);
                    pm10->CopyRect(0, 0, patchsize / 2, patchsize / 2, dest, patchsize / 2, 0);
                    pm01->CopyRect(0, 0, patchsize / 2, patchsize / 2, dest, 0, patchsize / 2);
                    pm11->CopyRect(0, 0, patchsize / 2, patchsize / 2, dest, patchsize / 2, patchsize / 2);
                    dest->Save("Terrain/32768/LOD" + String(lod + 1) + "/" + String(x) + "_" + String(y) + ".dds");
                }
            }
            num /= 2;
            lod++;
        }

     

    • Like 2
  4. I've got it working better now. There are several factors to take into account when you choose your settings. How reflective is the scene? What resolution do you want the voxels to be? How many cascaded grid are there? How quickly do you want the GI data to update? Faster updates means slower overall performance, but it can be scaled back and forth depending on your usage.

    • Like 3
  5. I think a combination of voxels for rough surfaces and polygon ray tracing for sharp reflections will provide the best results. Neither of them can really do both.

    The RTX approach is an extremely brute force method, and I think I can get better much performance with other means.

    It's kind of funny that right now we basically have a power struggle between engine developers and hardware manufacturers. I hope the GPU makers don't try to take over more in the future.

  6. Here is the code for creating a heat haze material:

        //Creaqte the material
        auto heathaze = CreateMaterial();
    
        //Make it see-through
        heathaze->SetTransparent(true);
    
        //Set the alpha component of the color to zero
        heathaze->SetColor(1, 1, 1, 0);
    
        //Apply a texture for the alpha mask. Even though the alpha color is set to zero, 
        //this will control the intensity of the refraction effect.
        heathaze->SetTexture(LoadTexture("Materials/FX/particle.dds"), TEXTURE_BASE);
    
        //Set the normal map
        heathaze->SetTexture(LoadTexture("Materials/FX/heathaze.dds"), TEXTURE_NORMAL);
    
        //Set the refractive index
        heathaze->SetRefractiveIndex(1.3);

     

×
×
  • Create New...