MaplibreGL JS, with terrain on, opacity of markers gets changed on moving - mapbox

I made custom html element for markers in MapLibre, so they can show some data.
When I added terrain to map (amazon rgb terrain), it happened that markers change their opacity while camera is moving.
By default it's 1 of course, but suddenly goes to 0.2. I can only suggest that while we move and scene being rendered again, MapLibre thinks that point is under the ground??
I coudn't find any mention of such problem with markers or places in docs about markers can change opacity because of terrain(
here is video demo of what happens
https://www.youtube.com/watch?v=6zqEOcTH2Pw

It happened to be collision with terrain. It works pretty well with default small droplet markers and stuff like that, but bigger html elements cause a lot of collisions which makes them hard to use with terrain for now. As I understand there is no easy solution for now.
Opened and issue on maplibre github https://github.com/maplibre/maplibre-gl-js/issues/1783

Related

Unity URP Material scripting

I just started using URP in Unity for a game in progress. I'm doing a sort of sprites-in-3d thing, so I'm rendering some sprite sheets on quads. To do this, I create a Material with the sprite sheet and use tiling/offset to render the proper frame of animation by making a call like:
CombatMaterial?.SetTextureOffset("_BaseMap", new Vector2( (AnimationDefinitions[animationDefinition] % 16) * .0625f, CombatMaterial.mainTextureOffset.y));
I'm currently trying to add some feedback into my game for when characters use abilities or get hit by flickering the material. Because the base color starts at white and goes to black, that won't really work; the only other thing I seem to have available to me is emission, which looks great. Using a 0xAAAish color achieves the effect I'm looking for. I've been using the Feel Unity asset to do this, but I've also attempted using something like this:
CombatMaterial?.SetColor("_EmissionColor", Color.white);
The problem is, once I've set the _EmissionColor, the main texture offset no longer updates in game, thereby ruining all animations. If I change the texture offset manually through the inspector at runtime, animations don't work AND the _EmissionColor flickering stop working. If I mess around with the color of the _BaseMap in the inspector, _EmissionColor flickering starts working again.
Before I start diving into some unsightly color adjustments in an attempt to make this work again, I would love to know if I'm doing something that is simply unsupported by URP/Materials/whatever, or if there is some alternative to what I'm doing that's a little more straightforward.
Thank you!
After trying a bunch of random stuff, I don't have a "real" solution, but the game IS working how I want it to.
What worked for me was setting the _EmissionColor on the Material to (1,1,1). For some reason, when the _EmissionColor is set to (0,0,0) it's a black (ha) hole and won't accept future changes to the _EmissionColor. I assume this is some shader nonsense (with the base Lit Shader that URP uses) that I am clearly unfamiliar with.
Hopefully this helps anyone doing something as pointlessly against the grain as I am!

Global Tiling in HDRP Combined with Parallax Occlusion Makes Messed up UVS

I'm trying to make a custom shader with Shader Graph on HDRP. The intention is to automatically tile textures based on global position so I don't have to worry about remaking materials when I resize things etc. (I'm sure you can imagine the usefuleness of this). But when I do that, combined with the Parallax Occlusion Mapping node (built into HDRP) for height mapping the UVs get all messed up, and the height mapping doesn't even seem to work for some reason.
I thought that if I fed any source UVs into the Parallax Occlusion Mapping node that it would work just fine, but for some reason it doesn't in this case (it's especially obvious when zoomed far in that something is wrong with the UVs). I'm fairly new to shader graph so I'm not exactly sure how to resolve this issue. Let me know if you need anything else from me.
Here is the relevant shader graph nodes (not pictured is pretty much just mapping textures directly into the output node, if you think it might be relevant I can post those too)
Here is the zoomed out version of the scene (with some sample textures) without my global tiling activated (top) and with (bottom). As you can see the tiling works but the height disappears:
And it gets worse if you zoom in (no tiling top, with tiling bottom):
You are missing to connect PixelDepthOffset to the corresponding entry in the Master node. It looks like it's shifting correctly the UV, but the rendering pipeline is not aware it should also change the depth pass accordingly.
You can enable the depth offset in the options of your master node, as follows:

No "Pixel Snap" option in 'Sprite-Lit-Default' material causing some sprites to tear

The Problem:
I have a pixel-art based project that uses tilemaps and etc. Previously with just the default material Sprites/Default, I have this "Pixel Snap" option:
However, ever since I upgraded to LWRP/URP; and used 2D Lights (my game has a day/night cycle); all of the sprites have to be upgraded to a new Sprite-Lit-Default material which allows my sprites to be affected by the 2D Lights. The only problem I noticed in this new material is that it hasn't got any "Pixel Snap" option:
And after I used this new material, I notice some of my sprites (specifically the ones on the Tilemaps) tear. It's not game breaking and it occurs sometimes, but it's really quite annoying (and let's face it, it looks bad for your game to have that bug).
I haven't noticed this tearing bug on my other sprites (player, trees, obstacles, etc) only particularly on the tilemaps.
What I've Done So Far:
My sprites are set to Point (no filter), and Compression is set to None. On my tile sprites, there are no transparent edges etc. Even if I use Unity's Pixel Perfect Camera, the problem is still there.
Duplicated my tilemaps and offset the other ones to -0.01 or -0.02 on its X axis (so just in case it would tear, the player would still see the same tilemap).
None of these things have fixed the problem so far.
Are there any ways to bypass/fix this issue?
Thanks a lot!
What Solved My Problem
I placed the tilemap sprites on a sprite atlas, set the filter to Point, set the compression to None, left everything else by default, and then clicked "Pack Preview".

Experiencing a strange tile rendering bug in Unity's Scene view

This issue only affects the Scene view, and it is not present in the Game view or when it is running.
Basically my map looks like this.
https://i.imgur.com/BBrKA5f.png
Zoomed Out
https://i.imgur.com/G8BuG8d.png
As you can see there are horizontal lines everywhere. The grid is turned off. They are mostly blue because underneath the grass tile on the sheet is the water tile. You can see under the left of the rock there is a yellowish line, this is because there is a sandy tile below it. The individual images from the Sprite editor look fine. No lines in them. As mentioned, this is only present in the scene view and doesn't affect the game so its not major. I would really like to see if this is possible to fix though as it is quite a pain to look at and design maps with. This issue is present on my PC, and both laptops so I don't think it's hardware related.
Tile palette images:
https://i.imgur.com/huNDlHy.png
https://i.imgur.com/uLwUpUM.png
I've tried adding them to an Atlas, checked for Point (no filter) and no compression. I'm at a loss. No one seems to know how to fix the issue and all my googling points me to bleed or tears in the actual game which is not the issue I am having.
Any help would be greatly appreciated and I will provide any additional information that is needed.
Thank you.
So after a few days of frustration and help from the Unity discord, I finally found an answer.
It turns out you want to disable Pixel Snap in your Shader component on your tilemap object. As soon as I did that all the lines in Scene View were gone.
Setting to change:

How to override physical marker in vuforia AR Camera in runtime?

How can I override the physical marker in unity to just make the physical marker invisible in camera while detecting any object.
Like in this video:
https://m.youtube.com/watch?v=R_F1LvK5gCk
And many other videos.
This maybe isn't the correct answer but, I'll put my ideas here because sadly it doesn't fit in the comment section.
I just watch the video and some of the reels they show as his works.
First, yes, in deed they make the marker a sort of invisible marker, but if you look closely, like a 0.25 speed and pushing space bar very fast to look it in slowmo, you can see a kind of "artifact" in between the girl's fingers that makes me think there's no invisible marker but a texture that are covering the marker. Maybe a cylinder that gets his texture from the video camera input.
Now, how I do that?
There are several ways to get the pixels from the webcamera, even Unity has one function. The trouble is, I dont want all the pixels but a little tiny part of the camera render, specifically the one's around my marker.
In my experience, and in his examples, they are using OpenCV, another unity plugin, so they can track anything, from faces, hands, or markers, so I can't be quite sure they are using Vuforia alone or in combination.
My idea is, with OpenCV you can catch your marker and his contour, then ask for the pixels outside the contour of your marker, those pixels will be the skin tone of the person and latter apply them as a texture over some plane or 3d model that can cover your marker. You can have the pixels at right side and left side of the marker and use a average function betwen them so it could look nice or if you like the adventures you can try to use some kind of digital images processing method to get bether results.
I'm not sure if you can have the pixels arround a marker just using just Vuforia. Honestly I've never try it before.
Well, that's my idea.
If you can get it better I'll like to hear about it.