Visual Glitch that Im not sure how to work out. CustomMaterial

https://playground.babylonjs.com/#BCU1XR#1359

This is kinda hard to wrap my head around, and I don’t see really why its happening.

Looks like I have everything working in this scene where you can “select” the bones on line 324. Problem is any time you modify those values the bone whos ID is next after a selected bone does a weird color fighting thing.

https://playground.babylonjs.com/#BCU1XR#1360

Just mess with line 324 array and you will see what I mean.

Pretty stumped here.

Hi @Pryme8, I’ve added an auto-messer, but I see no glitches?

https://playground.babylonjs.com/#BCU1XR#1361

so you dont see the scrambled ones?

No, to me it looks like this:

I just tried it on my phone, and it looks OK as well

Whoa… ok, ummmmm what does that mean then?

Uhhh first thoughts, your looking at a webGL 1.0 version? Whats your phone and browser.

Oooof, wrong I guess because it does not even run in Edge; but it works on my phone? I am officially confused.

Umm help? Someone this is gonna make me go insane if I am the only one that sees it. Any ideas anyone?

Chrome with a GTX 680 is freaking out.

I wonder if its tied to refresh rate? Im running at 120 mhz none of this really makes sense.

1 Like

I don’t know what means, but I have these extensions enabled it seems like:

изображение

https://webglreport.com/?v=2

I tried the playground with engine.GetCaps() neutered, but it still renders OK:

EXT_color_buffer_float
EXT_disjoint_timer_query_webgl2
EXT_float_blend
EXT_texture_compression_bptc
EXT_texture_compression_rgtc
EXT_texture_filter_anisotropic
KHR_parallel_shader_compile
OES_texture_float_linear
WEBGL_compressed_texture_s3tc
WEBGL_compressed_texture_s3tc_srgb
WEBGL_debug_renderer_info
WEBGL_debug_shaders
WEBGL_lose_context
OVR_multiview2

Its gotta be my GPU, it does it in firefox as well.

I have the same problem here, with a GTX 1080.

It is a precision problem. If you do:

    if(abs(rootBoneId - float(selectedBones[i])) < 0.5){
        result = COLOR_SELECTED;
        break;
    }

instead of:

    if(int(rootBoneId) == selectedBones[i]){
        result = COLOR_SELECTED;
        break;
    }

it does work:

https://playground.babylonjs.com/#BCU1XR#1365

2 Likes

dang I did the whole rootBoneID - method but just made it == 0…

Should have thought of an epsilon good catch!