TGViewer
Channel Public Channel
Everyday Unity

Everyday Unity

@everydayunity

A game developer and tech lead in a top grossing company posting Unity, programming, and gamedev related stuff that I find interesting
Website: https://gamedev.center

Most used tags are:
#performance
#shader
#interview

Author: @alexmtr
Subscribers
1.18K
Photos
169
Videos
61
Links
2.4K

Showing posts older than #1671 · Back to latest

Older Posts 20 shown
Post #1670 90
Polygon Clipping (Part 1 & 2)

Polygon clipping is an interesting problem: how do you intersect, union, or diff two polygons?
The Greiner-Hormann clipping algorithm is quite beautiful and intuitive. However the Greiner-Hormann clipping algorithm cannot deal with coincident lines. This turns out to be a huge pain – so there is part 2 that works for all polygons.

https://sean.cm/a/polygon-clipping-pt1
https://sean.cm/a/polygon-clipping-pt2

#polygonclipping #clipping
  • 👍 2
Post #1668 93
Post #1667 81
Culling system and effects for Top-Down games

Simple fade out/culling system for top down game with 3 different shader-based effects to fade out objects that get in the way of the player seeing their avatar

https://www.patreon.com/posts/culling-system-60214085

#cull #vfx
  • 👍 2
Post #1665 83
Post #1659 81
Talking to your unmanaged code efficiently from Unity using P/Invoke

How to use P/Invoke with blittable types. A type is blittable if it has the same memory representation in C# as in the target language.

https://medium.com/baracoda-engineering/talking-to-your-unmanaged-code-efficiently-from-unity-using-p-invoke-6bb26f43f428

#extern #plugins #pinvoke
Medium Talking to your unmanaged code efficiently from Unity using P/Invoke Sometimes Unity projects need to interface with native plugins that are written in other languages, or maybe your company has a library in…
  • 👍 2
Post #1658 86
Trajectory prediction in Unity

Predict trajectory with Physics.Simulate. Not sure about performance if there is a lot of stuff going on, but should be absolutely fine for small simulations. Anyway in case you use Physics.Simulate a lot dont forget to always profile before optimizing. Or if you are still in a preproduction phase, make a small proof of concept with expected amount (and more for greater confidence) of operations to simulate, so you can be sure that this approach is suitable for your case.

https://www.youtube.com/watch?v=4VUmhuhkELk

Repo: https://github.com/ToughNutToCrack/TrajectoryPrediction

#simulation #physics #trajectory #prediction
YouTube Trajectory prediction in Unity In many games, especially in 2d puzzles, the player can see a line that represents the bullet trajectory before shooting. This mechanics is used for example in Puzzle Bubble, Tank Wars, Peggle, and many more. It's commonly used for power-ups or tutorial levels.…
  • 👍 1
Post #1653 81
UI with rectangles? Don't use null as a source!
Create a 1x1 square image and add it to your sprite atlas. That way all rectangles will be drawn together with the images. You can reduce several draw calls per frame!
When using a null reference in an Image field: "None (Sprite)", Unity actually puts a UnityWhite texture in there that causes the GPU to make an additional draw call.

https://twitter.com/HetiDev/status/1493317817688629252

#ui #optimization #tips
Twitter Heti #unity3d UI with rectangles? Don't use null as a source! Create a 1x1 square image and add it to your sprite atlas. That way all rectangles will be drawn together with the images. You can reduce several draw calls per frame! #unitytips #gamedev #indiedev…
  • 👍 1
Post #1651 79
Triangle.Net-for-Unity

Triangulation lib wrapper for Unity. Triangle.NET generates 2D (constrained) Delaunay triangulations and high-quality meshes of point sets or planar straight line graphs. I guess you already knew about it, if you were interested in mesh generation. If not, then if you ever stumble upon triangulation in Unity, you should know there is the lib available for doing it.

https://github.com/Nox7atra/Triangle.Net-for-Unity

#triangulation #mesh
GitHub GitHub - Nox7atra/Triangle.Net-for-Unity Contribute to Nox7atra/Triangle.Net-for-Unity development by creating an account on GitHub.
  • 👍 2
Older posts →
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →