#Graphical glitches

1 messages Β· Page 1 of 1 (latest)

arctic crypt
#

On steam page it says that AMD gpus are not supported, so Im not sure if it is okay to post here.

So I got these things rendering, looks like something is missing or idk.
My specs:
OS: Void Linux; Kernel 6.6.32_1; Sway (Wayland)
GPU: AMD RX 6750 XT; Mesa 24.0.7_1
CPU: AMD Ryzen 5 3600

indigo sandal
#

This is a AMD-specific driver bug.
We can't officially support AMD yet because of this, and it's not the only issue.
Their Windows driver can't even start the game.

arctic crypt
#

Understood. Thanks for clarification and sorry for bothering. I saw comment on Reddit that was saying that it could work on rdna2 with RADV on Linux and just wanted to be sure.

indigo sandal
#

RADV works a bit better than amdvlk, but there are still bugs.

#

Although, I haven't tried the latest AMDVLK driver on Linux, apparently they now support recursive ray-tracing like RADV, maybe you could give it a try!

vestal locust
#

I tried the latest amdvlk on Arch, but unfortunately no luck just freezes before loading into the game. I get similar to the previous post but slightly less annoying looking graphical aritfacts in radv

Kernel: Linux 6.9.3-zen1-1-zen
Driver: Mesa 24.1.0-arch1.1 (LLVM 17.0.6)

Ahh well, hopefully a fix comes soon. I'll try some other things too

indigo sandal
#

Thanks for testing! πŸ™‚

vestal locust
#

One thing I noticed is the graphics in the far LOD seem to be fine, you can see the transition in this screenshot.

The framerate is perfect though, not much going on but I get around 60-70fps at 4k when there's nothing but terrain on screen anyway.

indigo sandal
#

yeah I know the bug very well, I've analysed it deeply, I know what causes it exactly.
that's how I made sure it's a driver bug

#

as for performance, you'll get 4X framerate by going to 1080p

vestal locust
#

Ah, yeah I did notice performance is exceptional, I ran it in gamescope at 1080p for one of my tests, is very nice πŸ™‚ Well, let me know if there's anything I can do to help

indigo sandal
#

Just let me know when AMD fixes their driver πŸ™‚ or if somehow you decide to open up RADV's source code and fix it...
This particular bug is caused by the driver not being able to handle procedural (AABB) shaders with ray-attributes while at the same time having triangle shaders in the scene.
Seems like they never tested that scenario...

#

so they don't like AABB ray-intersection shaders that write to ray-attributes in a scene that's mixed with aabb+triangle geometries together, which is totally valid....

vestal locust
#

Idk if it's worth posting being a driver issue and all, but I was messing with the shaders to see if I could work around some of the wonkyness and.. well this happened.. It randomly started alternating between working perfectly and the above every second, sometimes it would stay in the perfect scenario. The only thing I've changed is I don't use the normal data on the models since it's corrupted

indigo sandal
#

other data in the hit attribs also get corrupted, but that actually looks good to play, if it stayed this way

vestal locust
#

goes without saying I'll keep trying, but thought you might be interested

indigo sandal
#

thanks for letting me know

vestal locust
#

Well I'm out of time for today, but I am getting closer, I've rewrote the barycentric coordinates so they don't use hitAttribute, instead calculating them from the ray and the triangle coordinates. I'm not sure why only one of the triangles here works, must be a bug with my implementation, but I'm making progress πŸ˜„

Also for the terrain I might need a hint, currently I'm just kinda cheating and using the normal (hence the terrain looks weird) because I'm not sure how to calculate the barycentric coordinates for the terrain, looks like it does have a triangle but not sure where to get info about it in the shader.

Most of my time has been spent figuring out how the shaders all fit together, but I think I get it now.
Also I can't get it to reproduce the randomly working thing like last time

arctic crypt
#

Love seeing community effort. Sadly I'm just a web developer and cannot really help with graphics

vestal shuttle
prime kestrel
#

The wiki is simple markdown. Anyone can πŸ™‚

vestal shuttle
#

Oh I didn't realise that, nice!

indigo sandal
#

the wiki is open source, so anyone can make a pull request and we'll merge it

vestal locust
#

Back to working on this again, have got triangle based entities working fully, which includes computers

indigo sandal
#

Oh that's wonderful!

#

I can see terrain is a bit lacking something I'm guessing that's because you disabled some vertex attributes from the terrain?

vestal locust
#

I'll give you a rundown on how I've achieved it so far, maybe you might have some pointers haha
I've added this function to common.inc.glsl

    vec3 GetBaryFromRay(vec3 origin, vec3 dir, float distance, vec3 a, vec3 b, vec3 c)
    {
        vec3 p = origin + dir * distance;
        vec3 v0 = b - a, v1 = c - a, v2 = p - a;
        float d00 = dot(v0, v0);
        float d01 = dot(v0, v1);
        float d11 = dot(v1, v1);
        float d20 = dot(v2, v0);
        float d21 = dot(v2, v1);
        float denom = d00 * d11 - d01 * d01;
        vec3 result;
        result.z = (d11 * d20 - d01 * d21) / denom;
        result.y = (d00 * d21 - d01 * d20) / denom;
        result.x = 1.0f - result.y - result.z;
        return result;
    }

And in the 1_entity_tri.rchit.glsl file I've added this.. EDIT: I derped and said the wrong file lol

#
        //vec3 barycentricCoords = vec3(1.0f - hitAttribs.x - hitAttribs.y, hitAttribs.x, hitAttribs.y); old way
    vec3 barycentric_coords = vec3(1.0f - hitAttribs.x - hitAttribs.y, hitAttribs.x, hitAttribs.y);
    uint index0 = gl_PrimitiveID * 3;
    uint index1 = gl_PrimitiveID * 3 + 1;
    uint index2 = gl_PrimitiveID * 3 + 2;
    if (GEOMETRY.indices16 != 0) {
        index0 = IndexBuffer16(GEOMETRY.indices16).indices[index0];
        index1 = IndexBuffer16(GEOMETRY.indices16).indices[index1];
        index2 = IndexBuffer16(GEOMETRY.indices16).indices[index2];
    } else if (GEOMETRY.indices32 != 0) {
        index0 = IndexBuffer32(GEOMETRY.indices32).indices[index0];
        index1 = IndexBuffer32(GEOMETRY.indices32).indices[index1];
        index2 = IndexBuffer32(GEOMETRY.indices32).indices[index2];
    }
    if (GEOMETRY.vertices != 0) {
        VertexBuffer vertexBuffer = VertexBuffer(GEOMETRY.vertices);
        vec3 v0 = vec3(vertexBuffer.vertices[index0*3], vertexBuffer.vertices[index0*3+1], vertexBuffer.vertices[index0*3+2]);
        vec3 v1 = vec3(vertexBuffer.vertices[index1*3], vertexBuffer.vertices[index1*3+1], vertexBuffer.vertices[index1*3+2]);
        vec3 v2 = vec3(vertexBuffer.vertices[index2*3], vertexBuffer.vertices[index2*3+1], vertexBuffer.vertices[index2*3+2]);
        barycentric_coords = GetBaryFromRay(gl_ObjectRayOriginEXT,gl_ObjectRayDirectionEXT, gl_HitTEXT,v0,v2,v1);
    }
#

Yeah, as for the terrain, it's just what I was using in the meantime so I didn't have to look at ugly triangles haha, that's what I'm working on next

#

As you can see it relies on knowing the coordinates of the triangle, so now I just need to figure out what the terrain bases that on and should be smooth sailing from there

indigo sandal
#

your approach looks good!
although I fear there can be a lot more shaders to change,... but it's not a bad idea actually..
I mean, if we assume that the triangle shaders are the ones that are corrupted but the AABB shaders don't get affected themselves, then it is perfectly possible to just recompute those bary coords for all triangle shaders..
the procedural aabb shaders however that's another story.,.. let's just hope these don't get affected

vestal locust
#

I'll see what I can come up with anyway, going to do a little bit of debugging to see if I can figure out the AABB stuff, as I think the terrain relies on it

indigo sandal
#

no, terrain is pure triangle geometries, and they use flat shading, their normal is computed from the shaders based on vertex coords

vestal locust
#

Ah! ok

indigo sandal
#

but they also fetch some more data for colors and splatting

vestal locust
#

That's all good, I think I can ignore the other data since it only appears to be the barycentric coordinates that a broken πŸ™‚

indigo sandal
#

correct

#

for triangle geometries that is

#

but I'm not sure anymore if the aabb geometries were also affected

#

is the Water glitching? are cables/pipes glitching?

#

are the rocks glitching?

#

those use AABB

#

also the atmosphere

vestal locust
#

Ah, I was going to ask what uses that haha, yeah they do glitch

indigo sandal
#

so those would also need to re-compute their hit attribs from the rchit then

vestal locust
#

ok, I'll get the easy stuff working first and come back to those

indigo sandal
#

and that's arbitrary data, per shader... unlike with the triangles which are just bary coords

vestal locust
#

ah

#

so probably impossible

indigo sandal
#

so can't generalize lol

#

that's why I'm saying it may be more work than what you're willing to put up with πŸ˜›

vestal locust
#

but atleast the game will be playable, just with glitchiness

indigo sandal
#

true!

#

hey if you wanted to take time to fix those, might as well fix the RADV driver itself? lol

vestal locust
#

haha if I could I would, I'm not even sure where to begin with that, it's not like it didn't cross my mind, but I only really game dev as a hobby

indigo sandal
#

So the problem is: it doesn't like to hit both AABB and Triangle geometries in the same trace when AABB ray-int shaders declare hit attribs...
It is very plausible that simply no one has even tried it, and the fix could be very simple

#

it would not surprise me if their unit tests would only test AABBs individually and Triangles individually, and maybe one test that tests both together but the AABB don't have hit attribs

vestal locust
#

Well I was looking at the bug reports over on Mesas website, looks like they're pretty friendly over there, I could try reporting it. What's the worst that could happen haha
https://docs.mesa3d.org/bugs.html

indigo sandal
#

yeah that's a good idea πŸ™‚

#

might as well add the link to our steam page lol

#

as long as you're having fun helping out, I'm all for it πŸ˜‰

#

going to bed now (4 am here), good luck and also might as well have some fun with the game since you can play now πŸ˜‰

vestal locust
#

haha yeah, thanks! And here's the terrain working now πŸ™‚

#

You can always revert by verifying your game cache

#

@arctic crypt feel free to give it a try πŸ™‚ you can actually use the computer now which makes the game playable

vestal shuttle
#

Epic

arctic crypt
arctic crypt
#

I think this should be pinned somewhere to let linux AMD people know that it is playable now with this workaround

vestal locust
#

Hey guys, so there's a fix for AMD that also works for water, but it hurts performance. And that's just to enable ray tracing emulation. This has the bonus benefit of likely working on GPUs without raytracing

Add this to your launch parameters in steam to try it out

RADV_PERFTEST=emulate_rt %command%
#

When the water takes up a large portion of the screen I'm getting around 38-45fps in 4k, default settings/medium

#

I've found that by looking at the command line options for radv, so will try a few others see if any works, that was just the first one that worked

#

I'm actually kicking myself for not trying it earlier, but I assumed performance would be unplayable lol

vestal locust
#

ok, do still get some glitchiness on triangle geometry, so worth combining with my shader modifications above

sterile stratus
#

Still linux only im guessing?

vestal locust
#

Yeah, sorry

thin spear
#

oh man thats amazing but still ouch for the linux only part

hoping someday drivers actually allow me to play the game... someday

arctic crypt
#

tried this launch parameter and water is not glitching as much
actually i get like 5fps more when looking at water
but when looking at terrain im getting like 10fps less than without parameter

sterile stratus
indigo sandal
#

if you want to run it via command line instead of through Steam, open a bash in Archean-game dir and run
./Archean steam
it will run with steam authentication/launcher (steam still needs to be running)
you can also run it offline with
./Archean offline

sterile stratus
#

the launcher crashes if i try to use naitve

indigo sandal
#

the offline mode will launch the game directly on the default world and without launcher

indigo sandal
sterile stratus
#

it throws a bunch of libstdc++ errors

#

gonna try updating

indigo sandal
#

ah, yes your distro doesn't have recent enough version of GLIBC

#

ubuntu 23.10 + works

#

or manjaro

sterile stratus
#

this is fresh mint 21.3 will update and try again

indigo sandal
#

21.3 is too old and GLIBC is most likely locked to a specific version

#

you'd need to update the distro, not just packages/kernel

#

but proton is good too I guess

#

I mean the game should also even run with Wine

sterile stratus
#

im getting 100+ fps on proton experimental

indigo sandal
#

you shouldn't see much of a difference at all in performance between proton and native

#

with ray tracing

sterile stratus
#

hmm still same err after seems like mint is stuck on proton then

indigo sandal
sterile stratus
#

just a note on AMD preformance, for some reasons looking at thrusters on the suit makes it drop a lot of frames