summaryrefslogtreecommitdiffstats
path: root/Shaders
Commit message (Collapse)AuthorAge
* Various shader cleanupyum2023-08-21
| | | | | | | * remove unused variables, functions, keywords * rename fixedN to floatN * move min/max raymarch distance to top of ray_march.cginc * fix frame emission
* Workaround: use STT mesh to write depth bufferyum2023-08-12
| | | | | | There's some bug around using the raymarched world position to write the depth buffer. I wasn't able to find it quickly, so for now, use the original world position to write the depth buffer.
* Improve numerical stability in raymarcheryum2023-08-12
| | | | | | | | | | | | Increase units by a factor of 100 to avoid running into numerical instability on 32-bit floats. This comes at zero measured performance cost. This makes a visible difference in quality. Other minor changes: * Raymarching loop tries to get up to 4x closer than MINIMUM_HIT_DISTANCE before bailing out. This comes at no measured performance cost. * Convert `fixed` types to `float` in STT_text.cginc.
* Bugfix: Shader no shows text mirroredyum2023-08-12
|
* Bugfix: ellipsis waits for boardyum2023-08-12
| | | | | Regression created while optimizing shader. Performance still around 730 microseconds on my computer with this change.
* Optimize skew-pyramid frame SDFyum2023-08-12
| | | | | Use symmetry to reduce # of distance calculations by 50%. Because the pyramid can be skewed, we can't reduce this by another factor of 2.
* Small raymarching optimizationsyum2023-08-11
| | | | | | | | | | | | Using PIX to quantify changes, reduce raymarcher runtime from ~1.0 ms to ~850 us. In order of impact: * Tighten raymarch min/max distances * Make `in_mirror` check truly branchless * Gate ellipsis animation with non-divergent if statement Everything else is < 10 microseconds of improvement.
* Add animated ellipsis to shaderyum2023-08-11
| | | | | | | Not yet done: * Animator toggle * OSC integration
* Remove extraneous dot when chatbox spawnsyum2023-08-10
| | | | | The chatbox background would not completely disappear at _Emerge = 0, so two dots would show up when the chatbox spawns.
* Bump up ray marching stepsyum2023-08-10
| | | | Performance impact remains to be seen.
* Clean up pbr.cgincyum2023-08-10
| | | | | Remove unused code & cruft. Ray marcher now updates i.worldPos before executing PBR shading, which fixes some artifacts.
* Add basic PBR parameters to new shaderyum2023-08-10
| | | | | No UVs for raymarched geometry yet, so drop textures. Also drop most old shader settings.
* Add skew pyramid to bottom of ray-marched chatboxyum2023-08-10
| | | | Looks more like a comic-style speech bubble now.
* Add show/hide animation for ray-marched custom chatboxyum2023-08-10
| | | | * Fix mirror behavior for ray-marched chatbox
* Begin work on show/hide animationsyum2023-08-10
|
* Add ray-marched custom chatboxyum2023-08-09
| | | | | | | | * Refactor shader code to make development easier. Templates are now as small as possible. * Update scaling code. Use Unity scaling instead of a blendshape. * Check in a fuckton of shader FOSS. Mostly unused. * Update TaSTT.fbx. Now has 6 faces instead of 2.
* Shader improvementsyum2023-05-22
| | | | | | | * Fix thin outline in transparent region of rounded corners * Remove anti-aliasing. Now that VRC supports it natively, this is no longer necessary. * Use more efficient noise function for dithering.
* Restore mipmap sampling in custom chatboxyum2023-05-22
|
* Drop torch from requirements.txtv0.11.2yum2023-05-01
| | | | | | | | | faster-whisper doesn't need it. This reduces install size from 6.00GB with base.en model to 1.70GB. * Use a single sampler in shader (enables using more than 16 textures) * Minor legibility regression - need to improve AA. * Enable backface culling in shader (minor performance win)
* Fix custom chatbox zwrite/depthyum2023-04-25
| | | | | | | Depth was being calculated wrong, causing text box to render behind objects it's in front of. * Fix package.ps1 compression. 7z was increasing file size, somehow.
* Custom chatbox shader writes depthyum2023-03-23
| | | | | | | | This fixes issues where the transparent corners of the textbox render in front of other materials, causing those other materials to skip rendering. * Update README.md with roadmap and avatar resource usage.
* Reduce texture memory usage for English speakersv0.10.0yum2023-03-21
| | | | | | | | | | We used to populate 7 4k textures + 1 2k texture for all users. Now if the user has configured `bytes_per_char=1` in the Unity panel, we just populate a single 512x512 texture containing the first 128 ASCII characters. This reduces texture memory usage by 99.74%, from 134.67 MB to 340 KB.
* Update .gitignore filesyum2023-02-13
|
* Add hack to reduce outlines around emotesyum2023-02-13
| | | | | | | | Don't render any part of an emote with alpha < 0.5. Improves visual clarity in the common case at the cost of generality. * Emotes now use physically-based shading. * Use round() to denoise shader parameters instead of floor()
* Finish emotesyum2023-02-13
| | | | | | | | | | | 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
* Begin work adding emotesyum2023-02-13
| | | | | | | | | | | | Done: * Users can add images to Fonts/Emotes/ * The basename of that image ('clueless.png' becomes 'clueless') is the keyword to make the image show up in game. * Fix a bug in the shader where letters on the 2nd texture and later would have UV outside of [0.0, 1.0] Not yet implemented: * transcribed words are encoded using emotes mapping
* Shader now supports custom cubemapyum2023-02-06
| | | | Applied to both PBS and TaSTT shaders.
* Do not use PBR shading on curve transparencyyum2023-01-31
| | | | Diffuse reflections can show up on this part.
* Implement simple anti-aliasingyum2023-01-31
| | | | | | | Sample the texture up to 5 times using the algorithm shown in `aa_sample_algorithm.py`. Results are averaged together. * Redo dithering PRNG
* Rework ditheringyum2023-01-31
| | | | | | | | | I realized that ddx(i.uv.x) tells us how wide the current pixel is w/r/t UV coordinates. We can use this to implement a better form of dithering, which gets weaker as the viewer gets closer and stronger as they get farther. * Fine-tune mip map filtering based on play testing
* Check in PBS, a very minimal physically-based shaderyum2023-01-29
| | | | | Strip out everything except the PBS bits from the TaSTT shader and put them into a standalone shader.
* Bugfixesv0.4.0yum2023-01-27
| | | | | | * Fix prefab: bounding box & position are now set to 0 * Fix shader: text is no longer upside down * Update README
* Enable texture-based PBR rendering of backplateyum2023-01-27
| | | | | | Users can now use PBR textures on their custom backplate! * Update TaSTT.fbx: UV map aspect ratio matches board
* Fix PBR metallicsyum2023-01-26
| | | | | | | Metallics now reflect the map's cubemap. * Remove SpecularTint (did nothing) * Adjust mipBias to be sharper
* Correct ddx/ddy calculationyum2023-01-26
| | | | | | | | | Need to calculate this in the space of letter UVs, not the overall text box UV space, in order for the correct mip maps to be chosen. * Expose dithering as a toggle in the shader * Actually generate mipmaps * Fine-tune mipmapBias for legibility
* Improve font renderingyum2023-01-26
| | | | | | * Enable streaming mipmaps on glyph bitmaps * Sample glyph bitmaps using mipmaps * Add temporal noise to letter UVs (dithering)
* Update Unity materialsyum2023-01-25
| | | | | | * Render at 3k render queue to avoid clashing with avatar meshes * Set reasonable shader defaults * Remove unused material
* Finish basic PBR shadingyum2023-01-25
| | | | | | | | | | | | | TaSTT shader now uses physically based rendering (PBR). Users can pick smoothness, metallic, and emissive. This implementation borrows heavily from catlikecoding.com's excellent tutorials, which are released under MIT No Attribution (MIT-0). https://catlikecoding.com/unity/tutorials/license/ To retain what little clarity remains in the shader, I have chosen not to attribute the code in the source itself.
* Begin work on PBR shaderyum2023-01-25
| | | | | | | | Light color themes revealed a need for a lit shader, since an unlit shader would be blindingly bright. This implementation doesn't really work in game. I suspect that I need to support more than just one global light.
* Enable more shader customizationyum2023-01-23
| | | | | | | | * Text color, background color, and margin color are all customizable now * Better organize shader parameters. User-facing params are exposed Like_This; internal params are exposed _Like_This. * Update README. More wordsmithing.
* package.ps1 now fetches all dependenciesyum2023-01-23
| | | | | | | Don't literally check in Python since it looks dodgy (rightfully so). Instead the build script just fetches it. * Update README, simplifying language and documenting other projects
* Bugfix: user-provided paths may now contain spacesyum2023-01-04
| | | | | | | | | | | | | | | | Previously, paths containing spaces would be interpreted by python's argument parser as multiple separate arguments, causing it to fail. Now we escape paths inside PythonWrapper using std::quoted(). * Improve PII filtering. Python output would contain multiple path separators (like C:\\Users\\foo\\), defeating the PII regex. * Silence compiler warning in PII filter. * Document usability improvements. * Transcription layer exponential backoff goes to ~infinity when paused. This is a hack, since we really don't need to transcribe at all when paused, but it lets us keep the code simple. Good enough until the next rewrite. * Shader only samples background when necessary. * Limit matchStrings() print()s to DEBUG mode
* GUI: Users can now control board dimensionsyum2022-12-29
| | | | | | | | Users can now control how many letters wide and tall the board is. Tested at 4x48, 5x60, 10x120, and 20x240. At 20x240, Unity freezes and does not make forward progress. Perhaps creating 4800 float parameters isn't a truly scalable interface.
* Add Scripts/generate_shader.pyyum2022-12-29
| | | | | | | | | | | | | | Now it's possible to generate shaders with a custom number of rows, columns, and bytes per character. All edits to the shader should go through TaSTT_template.shader. To generate a new shader from the template: $ ./Scripts/generate_shader.py \ --bytes_per_char 2 \ --rows 1 \ --cols 12 --shader_template $(pwd)/Shaders/TaSTT_template.shader \ --shader_path $(pwd)/Shaders/TaSTT.shader
* Touch up TaSTT.shaderyum2022-12-25
| | | | | | | Add a new shader to make the box a little prettier. * Reduce material slots required from 2 to 1 * Add rounding to edge of box
* Add shader togglesyum2022-12-21
| | | | | | * Fix shader background rendering * Add ability to control margin size * Add ability to disable speech indicator
* Check in `World Constraint.prefab`yum2022-12-20
| | | | Can simply drag this into hierarchy & update reset target.
* Add emotesyum2022-11-26
| | | | | | | | | | | | | | | | | | | | Add emotes.py. It accepts a list of images and creates a texture with 64 total embedded images. The shader knows how to draw these into fixed 6-character-wide slots. Each slot must be aligned to a 6-character boundary. osc_ctrl has to pad with spaces to make this work. This whole patch is a little more complicated than it has any right to be, but my brain feels fuzzy and I don't know where to start fixing it, so I'm going to leave it shitty-but-functional for now. There's also some bug where writing a character into the 11th slot causes it to show up at the end of the board. I'll figure that out later, idk. I didn't include any of the emotes I use since I couldn't find any info on their licenses. I'm just banking on having a good workflow later on so people can add their own.
* Code cleanupyum2022-11-25
Reorganize locations, remove a couple unused parameters.