From 3089bd2ea6a3952e3ea0f31d8fc5eca1864cefab Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 1 Dec 2024 00:11:04 -0800 Subject: Add small programmable text display gimmick Use Third_Party/gen_atlas to create a 512x512 texture and put it in the texture slot (the resolution is hardcoded to 512 in shader). Use sliders to control the grid size. If desired, use global offset to make it possible to linearly animate between e.g. 0-9 and have it display as ASCII '0'-'9'. --- disinfo.cginc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'disinfo.cginc') diff --git a/disinfo.cginc b/disinfo.cginc index c5cc19c..8a6a162 100644 --- a/disinfo.cginc +++ b/disinfo.cginc @@ -87,9 +87,7 @@ float4 renderInBox(int c, float2 uv, float2 cell_uv, texture2D font, int2 font_r remapUVBigger(cell_uv, letter_bot_left, letter_top_right, letter_uv); #if 0 - float4 font_color = font.SampleGrad(linear_clamp_s, letter_uv, - abs(ddx(uv.x)) + abs(ddx(uv.y)), - abs(ddy(uv.x)) + abs(ddy(uv.y))); + float4 font_color = font.Sample(linear_clamp_s, letter_uv); #else float4 font_color = font.SampleLevel(linear_clamp_s, letter_uv, 0); #endif -- cgit v1.2.3