From 1cb5bdfe8cba6fe4647448cd3cf0c63ecbd7dfc2 Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 2 Feb 2023 18:00:18 -0800 Subject: Finish emotes Emotes require 2 bytes per char. They're encoded into the region [0xE000, infinity). The texture is 4k, and uses 1k vertical pixels per emote segment, for a maximum of 32 segments. * Reduce volume of noise indicator by 90%. Quiet is probably better. Might want to add a volume slider idk. * Bugfix: emotes without a transparency channel now work * Address a couple Unity performance complaints about the shader --- Scripts/generate_shader.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Scripts/generate_shader.py') diff --git a/Scripts/generate_shader.py b/Scripts/generate_shader.py index cf113ec..15dc9b9 100644 --- a/Scripts/generate_shader.py +++ b/Scripts/generate_shader.py @@ -48,11 +48,11 @@ def generateCgConstants(nbytes: int, nrows: int, ncols: int, prefix: str = "") - # This is the basic idea of what we're generating: # // Get the value of the parameter for the cell we're in. -# int GetLetterParameter(float2 uv) +# uint GetLetterParameter(float2 uv) # { # float CHAR_COL = floor(uv.x * Cols); # float CHAR_ROW = floor(uv.y * Rows); -# int res = 0; +# uint res = 0; # # [forcecase] switch(CHAR_ROW) { # case n: @@ -64,8 +64,8 @@ def generateCgConstants(nbytes: int, nrows: int, ncols: int, prefix: str = "") - # case 1: # ... # -# res |= ((int) round(_Letter_Row00_Col00_Byte0)) << (0 * 8); -# res |= ((int) round(_Letter_Row00_Col00_Byte1)) << (1 * 8); +# res |= ((uint) round(_Letter_Row00_Col00_Byte0)) << (0 * 8); +# res |= ((uint) round(_Letter_Row00_Col00_Byte1)) << (1 * 8); # continue; # } # } @@ -84,7 +84,7 @@ def generateLetterAccessor(nbytes: int, nrows: int, ncols: int, prefix: str = "" lines.append(prefix + " case {}:".format(col)) for byte in range(0, nbytes): param_name = generate_utils.getShaderParamByRowColByte(row, col, byte) - lines.append(prefix + " res |= ((int) round({})) << ({} * 8);".format(param_name, byte)) + lines.append(prefix + " res |= ((uint) round({})) << ({} * 8);".format(param_name, byte)) lines.append(prefix + " return res;") lines.append(prefix + " default:") lines.append(prefix + " return 0;") -- cgit v1.2.3