Author Topic: Call me crazy!  (Read 4959 times)

JackOatley

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
  • Nobody
    • View Profile
Re: Call me crazy!
« Reply #15 on: May 16, 2017, 07:48:59 PM »
I put voxel editing in, it's now also a breeze to plot models as well. There's still some chunk-border issues, as always. And there's an issue with trying to edit a chunk while it's voxel buffer is currently held in another thread, it doesn't wait for it yet. Oh and there's a memory leak somewhere. But otherwise it's going well!

https://twitter.com/f_oatley/status/864224998394929156
https://twitter.com/f_oatley/status/864512766450827267

JackOatley

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
  • Nobody
    • View Profile
Re: Call me crazy!
« Reply #16 on: May 24, 2017, 01:44:26 PM »
I added per-vertex ambient occlusion last night, managed to do it with little speed impact as well. Though it's currently done "live" in the meshing thread, where really I want it included in the voxel prefab so I never have to calculate it again, merely pick it out with a bitmask. And the bitmask should be calculated in the culling thread, probably combined with the culling mask (as that can also be used for AO).

Anyway, pics, notice the trees, they benefit the most from the AO, giving them nice dark hidden areas:



R34LD34L

  • Sr. Member
  • ****
  • Posts: 340
  • "TERRABLOX!!!!!!!!"
    • View Profile
Re: Call me crazy!
« Reply #17 on: May 24, 2017, 06:13:06 PM »
Gives the game such ambiance < realized that this is not the same word what so ever....*Kills self *
Schematic Mod Thingy!!!!

JackOatley

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
  • Nobody
    • View Profile
Re: Call me crazy!
« Reply #18 on: May 25, 2017, 01:20:00 AM »
I started implementing the block index, so the engine can now actually have multiple textures over a single block. I'm thinking of changing it from what I had before though, so instead of referencing the index number of the texture to use, it could instead reference the name (as textures are single files now).

I also got transparent textures working, as usual it's only opaque and completely transparent.



I think it looks really good now, but I definitely need to do something with the sky and water to really finish off these still scenes. Those things look way too flat now.

It's also worth nothing that I haven't even started with custom shaders. I'm thinking I will have to eventually, there's things that don't quite make much sense how they are right now, for example: three.js uses 32 bit floats to represent a single color channel when using buffer geometry (this holds a value from 0 - 1), you can put data into a 8 bit uInt and it won't error but the default shader doesn't seem to recognize the (correct) 0 - 255 data. When I do though, I won't make the mistake I made last time with over-optimizing, cramming all that data bitwise into the various vertex data ultimately made it un-portable.

EDIT:
I got manually created mip-maps working, when I say manually, it's still automatic, but done by the engine now and not by three.js/WebGL. This yields better results but there's still issues. There doesn't seem to be a way, at least that I can find, to set the minimum LOD for mip-mapping. So you're forced to use mip-maps all the way down to 1x1. Which is far from ideal when using a texture atlas. For example; my atlas currently has 4 x 4 textures on it, now if the size of the mipmap is 2x2 or 1x1 then tiles start getting blended together, resulting in the wrong colors on screen when it uses those mip levels. As seen in the brown tree tops and green sand in this image:



That's the only issue with mip-mapping left. So I'll keep looking because it seems like something that should be simple to change.
« Last Edit: May 26, 2017, 11:44:49 AM by JackOatley »

JackOatley

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
  • Nobody
    • View Profile
Re: Call me crazy!
« Reply #19 on: May 30, 2017, 12:35:20 AM »
I've been working a lot with getting all these little graphical features working well together. Despite still not being able to set a minimum mipmap LOD, I got it working together with tile borders which can be used to somewhat alleviate the issue.

I also set antialising on, which helps create a smooth image at 1:1. Previously, to get a smooth image I've been drawing at double res then scaling down (SSAA, on a browser this is as simple as zooming out the page).



The blue speckles on the mountain are due to the same mipmap LOD issue... When using the borders, the final image may not be a power of 2, so it has to be resized and currently the areas of the image not filled by the actual texture are blank and these get blended into the smaller mipmaps.

And forgive the seams you can see on the mountain too, they are temporary. They are due to me doing the Vertex-AO in the mesh thread, so only voxels visible inside that chunk are available to check against. This will be changed so the VAO is done in the culling thread and those edge voxels will be present.

EDIT:

Fixed those previous issues. I now fill in any empty space on the final texture, it's also optimal (depending on how many tiles there are) to use half the tile width as the border, as this perfectly fills out into a power of 2. There was still an issue where deliberate alpha, such as that on the leaves, was also bleeding into smaller mipmaps, I now resole this by "overdrawing" the tiles on lower mipmaps, this gradually makes the tiles become fully opaque, as you can see here:



As you can see, leaves further away become a solid color. Another thing that fixes some of the mipmap issues is anistropic filtering, which determines how many samples are taken to work out which color to use on screen from various mipmaps, this certainly fixed the brown tree tops, as it's reading in more greens from the bigger mipmaps.

Anyway, over than tidying up, I think I'm done with that graphical stuff. :)
« Last Edit: May 30, 2017, 06:54:05 PM by JackOatley »

JackOatley

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 732
  • Nobody
    • View Profile
Re: Call me crazy!
« Reply #20 on: October 01, 2017, 02:36:01 PM »
Hey guys, or anyone who still checks here, lol! Been out the loop for a while due to jams, I even hosted one. Ya'll used to my priority shifting now, anyway, I imagine!

Anyway, this project is still going, I've learned a lot more using JavaScript and currently rewriting a lot of it to work with NPM and build systems on there like webpack. So basically converting it from hackky fake modules to actual ES6 standard modules, which are currently not supported in any browsers (except maybe Opera), thus need transpiling through build systems. But, that's how I'm making my jam games these days and it's a great move towards making this open source.

Current problem after coming back to it after a while; suddenly the directional lighting is really laggy. Not sure why, either newer GFX card drivers are being weird or maybe I need to update my browsers again. I don't think it's my faults, haha, nothing in the code has changed afaik!

I'm working on something else as well currently. But in a couple weeks when that goes closed alpha, I'll be sharing time with Terrablox again. I'll post here occasionally, but otherwise you'll see my activity jump up on Twitter. :)

Matchesia

  • Full Member
  • ***
  • Posts: 219
  • A Person
    • View Profile
Re: Call me crazy!
« Reply #21 on: October 05, 2017, 12:14:21 AM »
Wow never thought I'd here from you again  :o  :D

It's dead, but not as dead as the chat.
https://discord.gg/BA9FpQJ

R34LD34L

  • Sr. Member
  • ****
  • Posts: 340
  • "TERRABLOX!!!!!!!!"
    • View Profile
Re: Call me crazy!
« Reply #22 on: October 10, 2017, 04:56:39 AM »
We are still here :)
Schematic Mod Thingy!!!!