Skip to content

Instantly share code, notes, and snippets.

View AMZN-alexpete's full-sized avatar

Alex Peterson AMZN-alexpete

View GitHub Profile
@AMZN-alexpete
AMZN-alexpete / GitRepoSetup.md
Created April 6, 2022 21:05
Typical Git (O3DE) Setup

Typical GitHub repository setup consists of at least two repositories, the upstream and the fork. Sometimes a third personal repository can also be useful. Here's how I typically name and setup my Git remote repositories:

  1. Clone the origin repository which is usually a fork where a team does work before merging it into the main upstream repository
λ git clone https://github.com/aws-lumberyard-dev/o3de.git
λ cd o3de
@AMZN-alexpete
AMZN-alexpete / ThinLineRendering.md
Created April 6, 2022 20:50
Thin line rendering ala Avalanche

From https://www.humus.name/Articles/Persson_GraphicsGemsForGames.pdf Phone-wire AA Siggraph 2012 presentation, Emil Persson, Avalanche Studios

  • Phone wires are long cylinder shapes, define center points, normal and radius
  • Avoid going sub-pixel by clamping radius to half-pixel size, then fade with radius reduction ratio to simulate sub-pixel coverage.
  • Also useful for railings, bars, antenna towers etc.
  • Still need to apply MSAA or other AA solution on top to smooth jaggies
// compute view-space w
float w = dot(viewproj[3], float4(In.Position.xyz, 1.0f));
@AMZN-alexpete
AMZN-alexpete / b.bat
Last active August 31, 2022 22:10
Batch script for building an O3DE project or engine using common settings.
@echo off
setlocal ENABLEDELAYEDEXPANSION
rem find latest VS version available
pushd "c:\Program Files (x86)\Microsoft Visual Studio\Installer"
for /f "usebackq tokens=*" %%i in (`call "vswhere.exe" -latest -format value -property catalog_productLineVersion`) do (
set Params=%*
for /f "tokens=1*" %%a in ("!%%i!") do EndLocal & set %1=%%b
set VSVERSIONYEAR=%%i
)
@AMZN-alexpete
AMZN-alexpete / c.bat
Last active May 23, 2022 17:50
O3DE configure .bat file for use inside engine or project folder
@echo off
setlocal ENABLEDELAYEDEXPANSION
rem IMPORTANT, make sure this 3rdparty path is correct
set CMAKE_PARAMS=-DLY_3RDPARTY_PATH="f:/git/3rdparty" -DLY_RENDERDOC_ENABLED=ON -DLY_PIX_ENABLED=ON
rem find latest VS version available
pushd "c:\Program Files (x86)\Microsoft Visual Studio\Installer"
for /f "usebackq tokens=*" %%i in (`call "vswhere.exe" -latest -format value -property catalog_productLineVersion`) do (
set Params=%*
@AMZN-alexpete
AMZN-alexpete / gist:a88892c25f82ee832a2b54ae2ed49bcf
Created September 4, 2020 23:26
Timing Git LFS operations
# turn off automatic lfs cloning
set GIT_LFS_SKIP_SMUDGE=1
# time cloning the repo without pulling LFS files
powershell -Command "Measure-Command {git clone https://example.com/repos/Lumberyard}"
# time pulling LFS files
cd Lumberyard
powershell -Command "Measure-Command {git lfs pull}"