Jun
8
2019

Set Quad Scale to Match VideoPlayer Aspect Ratio

Needed quick videoplayer quad mesh resizer, to match video size, so here’s a small editor helper script:https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Editor/ContextMenu/GetVideoAspectRatioEditor.cs It checks video width and height, and then scales transform Y axis to match aspect ratio.

May
26
2019

ffmpeg stream raw video into Unity Texture2D

Small proof-of-concept idea about streaming raw video from commandline ffmpeg into Unity, using UDP streaming. It works ok for small resolution and low fps rate, but breaks/goes out of sync if any udp data goes missing. Sources:https://github.com/unitycoder/ffmpegStreamToUnity Instructions:– Download ffmpeg https://ffmpeg.org/download.html– run from commandline: > […]

May
25
2019

Enable HDR Color picker for Shader or Script

I needed HDR color for some old Unlit/Color-shader, and for c# script also, found out that you can add this attribute for the shader: And for the script: More info:https://docs.unity3d.com/ScriptReference/ColorUsageAttribute.htmlhttps://docs.unity3d.com/Manual/SL-Properties.html Also make sure your Camera has [x] HDR enabled

May
23
2019

Scrolling Texture Plotter using CustomRenderTexture

Saw interesting question in the forums (link) about drawing plotter like data that would scroll up, got idea about custom rendertextures (since it was similar to this effect) Basic idea: – use CustomRenderTexture, double buffered so it can read from itself – draw color32 array […]

May
12
2019

Using SharpCompress in Unity

If you need to work with zip/rar/tar/gzip packages, can use SharpCompress to handle opening or creating those files. Compile SharpCompress DLL (unless you can find it online somewhere) Download project https://github.com/adamhathcock/sharpcompress Unzip and open in VisualStudio (i used 2017) Security warning, press ok Security warning, […]

May
9
2019

Creating Single .EXE from Unity Build Files

Using Enigma Virtual Box https://enigmaprotector.com/en/downloads.html – Select input file name: (This is .exe file from unity build)– Enter output file name: (this is the output single exe file) *This MUST be same as the original .exe file name, so that data folder gets found.– Click […]

May
9
2019

FAST-Algorithm for Corner Detection in Unity

Converted this (basic) algorithm into Unity c# https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_fast/py_fast.html FAST (Features from Accelerated Segment Test) is a way to detect corner features from an image. Source: *not optimizedhttps://gist.github.com/unitycoder/7649f62a6eceeb761db7f0092d9c3df1

May
6
2019

Ray Marching

Tested ray marching in Unity after watching this episode of The Coding Train. Source code:https://gist.github.com/unitycoder/7120e492deba748dba3d4e1e424d3c2a Usage:Set camera to 0,0,-10Projection: OrthographicThen Place spheres under empty gameobject, with sphere z values at 0

Apr
25
2019

Simple Image Tracking AR Android app using Vuforia

How to build simplest possible android AR app in “few” steps. ( No coding at all! ) Download Unity 2018.3.x https://download.unity3d.com/download_unity/06548a9e9582/UnityDownloadAssistant-2018.3.13f1.exe Install with these 3 options selected: [x] Unity, [x] Android Build Support, [x] Vuforia support. *Visual studio might be listed here also, if you […]

Apr
4
2019

RANSAC 2D Line Fitting

Converted this RANSAC 2D line fitting pseudocode into Unity c# http://www.visual-experiments.com/demo/ransac.js/ What is RANSAC? https://en.wikipedia.org/wiki/Random_sample_consensus Source code:https://gist.github.com/unitycoder/53495435c28853ef6522ff60d5c6a091 *Note this is not optimized at all, just a quick test Usage instructions:– Add this script to empty gameobject– Add gameobjects as a child of that gameobject (place […]

Pages:«1...6789101112...50»

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.