TA Log 05092022

Tiling Texture Variation: https://iquilezles.org/articles/texturerepetition/ Blender: https://www.youtube.com/watch?v=-VgtSL5ZpYc Visible repetition of texture is the common problem of a large scale mapping. To avoid the repetition, we can: add random offset and orientation to each tile. This has a boundary problem, because tiles won’t match anymore. Mipmapping will break because the discountinuity in the final texture fetch coordinates themselves. To solve the problems, we can sample multiple times with offset and orientation and blend them near the border of the tile....

May 9, 2022 · Kyle Fang

TA Log 04242022

Fast Arctan and Arctan2 in [-1, 1] https://www.dsprelated.com/showarticle/1052.php One of the approximation of arctan() is: $$ atan(z) \approx \frac{z}{1.0 + 0.28 z^2} $$ Another is a polynomial: $$ atan(x) \approx 0.9724x - 0.1919x^3 $$ Vegetation Procedural Animation GPU Gem 3: https://developer.nvidia.com/gpugems/gpugems3/part-iii-rendering/chapter-16-vegetation-procedural-animation-and-shading-crysis Vertical Weight Simply using y-axis as weight on swing calculation might not be enough. When the mesh is too high on the y-axis, the bending will be too strong to look good....

April 24, 2022 · Kyle Fang

TA Log 04182022

TA Log Dynamic Link Library Unity automatically compiles our code in Editor, but compiling code first is usually the way in the development. Using dll ensures that accidental editing will not happen during the development, but it also means direct editing is impossible, which makes development harder. How to create dll files is easy: create a ClassLibrary in IDE Add source code Add reference. Unity’s referenced files are in the Editor directory and project’s library directory....

April 18, 2022 · Kyle Fang

TA Log 04132022

URP TEXTURE2D_ARGS and TEXTURE2D_PARAS help passing texture and sampler to methods. TEXTURE2D(_AlbedoMap); TEXTURE2D_SAMPLER(sampler_AlbedoMap); half4 SampleAlbedo(float2 uv, TEXTURE2D_PARAM(albedoMap, sampler_albedoMap)) { return SAMPLE_TEXTURE2D(albedoMap, sampler_albedoMap, uv); } // to call SampleAlbedo, we have: half4 albedoAlpha = SampleAlbedo(uv, TEXTURE2D_ARGS(_Albedo, sampler_Albedo)); https://catlikecoding.com/unity/tutorials/scriptable-render-pipeline/global-illumination/ Vertex Compression vs. Mesh Compression Vertex Compression is in the Player Settings. It works on all the mesh files. It will compress vertex data from 32-bit to 16-bit to help the game’s performance by reducing the mesh data size in memory and file size....

April 13, 2022 · Kyle Fang

TA Log 03212022

TA Log Created: March 21, 2022 12:23 PM HLSL float is 32 bits. It is for world space position, texture coordinates, trigonometry or power/exponentiation. half is 15 bits. It is for short vectors, directions, object space positions, high dynamic range colors. real is half in default if the platform supports it. It can be either half or float in a function fixed is not supported in HLSL. Old CG syntax....

March 21, 2022 · Kyle Fang