#Voxel engine

1 messages · Page 1 of 1 (latest)

lethal pike
#

.

#

is tutorial about voxel engine

merry heart
#

That is a lot of math that I don't understand how it works

lethal pike
#

yeah

merry heart
#

We didn't cover this kind of stuff in University either 🤣

lethal pike
#

i ever make voxel engine without game engine

#

with 1 year and after year i move to unity and remake it 4 time

#
  1. advance math
  2. advance code
  3. advance optimize
#
  1. procedural code
  2. noise
merry heart
#

This is for a University project, by the 16th of may 2024 I gotta have a working game I don't have time to learn how every single bit and detail works haha

lethal pike
#

i have question

#

why do you make voxel?

merry heart
#

because the idea of the game I had requires voxels

lethal pike
#

oh

#

what do u want feature?

#

i can give some tutorial

#

just as generate mesh chunk?

merry heart
#

i mean right now i'm just having one issue

#

Nahh not there yet

#

The textures seem to not be connecting properly atm, tryinna figure out why

lethal pike
#

ok

#

what is mena

#

texture is not connect?

merry heart
#

You see how there is lines in between the blocks

#

That

lethal pike
#

oh i see it

merry heart
#

Yeah haha

lethal pike
#

i know haha wait.

#

can show code gen mesh?

#

every voxel engine is have this issue

merry heart
#

Sure, I tried copy-pasting what the code that the guy on YouTube had in case it was my code that broke things but it wasnt

#

It aint java but oh well

lethal pike
#

show me setting texture

#

at texture atlas

merry heart
#

I disabled mip-mapping

lethal pike
#

go to advance

merry heart
#

I noticed that changing the Tiling X and Y values by 0.01 fixes that problem, but I feel like it may have side effects

lethal pike
#

show me texture blocks

merry heart
#

it's just a 16x16 atlas, each block being 8x8

lethal pike
#

try change wrap mode to repeat

merry heart
#

I tried that already, it didn't do much

#

So far the two solutions that worked were:

  1. Changing the tiling X and Y values OR the offset by 0.01
  2. Disabling anti-aliasing
stoic patio
merry heart
#

Yep I have

lethal pike
#

i use mipmap gen
i dont have any issue

#

try change uv to some block

merry heart
#

idk online I saw a lot of people saying that mip-mapping breaks things

stoic patio
#

@merry heart have you tried disabling msaa, it can cause this type of issues too

merry heart
#

I am not sure where I can disable that

lethal pike
#

try uvs.Add 4
0,0
0,1
1,1
1,0

#

change code debug it

#

try change gen face uv to full texture
dont use procedural uv from block
test debug

stoic patio
merry heart
lethal pike
#

uvs.Add(new Vector2(x,y));
uvs.Add(new Vector2(x,y + VoxelData.NormalizedBlockTextureSize));
uvs.Add(new Vector2(x + VoxelData.NormalizedBlockTextureSize,y));
uvs.Add(new Vector2(x + VoxelData.NormalizedBlockTextureSize,y + VoxelData.NormalizedBlockTextureSize));

#

comment

#

and try add this line
uvs.Add(new Vector2(x,y));
uvs.Add(new Vector2(x,y + 1));
uvs.Add(new Vector2(x + 1,y));
uvs.Add(new Vector2(x + 1,y + 1));

merry heart
lethal pike
#

oh wait wait

#

is will error

#

wait

merry heart
#

yeah it didn't fix anything haha

lethal pike
#

uvs.Add(new Vector2(0,0));
uvs.Add(new Vector2(0, 1));
uvs.Add(new Vector2(1, 0));
uvs.Add(new Vector2(1, 1));

#

try it

stoic patio
merry heart
lethal pike
#

can you see error?

#

is dont have?

merry heart
#

Nah, there isn't an error

lethal pike
#

really?

merry heart
#

I think it's just some graphics settings

#

Yeah

stoic patio
lethal pike
#

try back code again

#

dont change graphic

merry heart
#

Yeah, I can only pick betweeh 8x, 4x, 2x and disabled

lethal pike
#

comment and try

merry heart
lethal pike
#

or code gen uv?

merry heart
#

I guess I'll have to write my own anti-aliasing or something for this?

stoic patio
merry heart
#

I don't see it in my options for some reason

stoic patio
#

Those are post processing methods

merry heart
stoic patio
#

So you need pp volume and stuff

#

But did disabling help?

merry heart
#

yeye it did, that is the problem

#

Another thing that fixed the problem was

lethal pike
#

summary is because graphic?

merry heart
#

adding an offset of 0.01 to both the X and Y values

#

That is another thing that fixed it

merry heart
merry heart
lethal pike
#

dont change tile offset is bad idea

stoic patio
# merry heart yeye it did, that is the problem

Thats what I thought because MSAA is kinda dum and extrapolates the interpolator data outside of the triangle area resulting few pixels near the triangle edges getting affected by the uvs that are part of the near by texture

merry heart
lethal pike
#

oh

merry heart
lethal pike
#

just dont use it

#

should focus how make voxel engine now haha

stoic patio
#

Dont use MSAA at all, take a look at post processing if you want to get access to FXAA

merry heart
#

Yeah but I mean if there's a way to use another type of aliasing through just clicking a couple things ill try it

#

So I'll just keep MSAA disabled until I look into FXAA?

merry heart
#

It's really bugging me though

#

Like

#

Online I see people's cameras have a lot more sub-components than mine

#

Such as the header rendering which allows to change the AA

#

But i dont have any of that

stoic patio
#

They use other render pipeline, most likely URP. Post processing is integrated to URP so its easier to use with it, with the BIRP you are using you have to import the Post Processing Stack V2 package to get any PP in the game

merry heart
#

Ah I see

#

It's defo something I can do at a later time anyway

stoic patio
#

I highly recommend taking a look at URP if you have time to do so but atm it shouldnt be high on your todo list

lethal pike
#

voxel engine it must make custom shader