Skip to repository content45 lines · 1.2 KB · text
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T04:12:38.080Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
color_text_raster.hlsl
1#include "alpha_correction.hlsl"
2
3struct RasterVertexOutput {
4 float4 position : SV_Position;
5 float2 texcoord : TEXCOORD0;
6};
7
8RasterVertexOutput emoji_rasterization_vertex(uint vertexID : SV_VERTEXID)
9{
10 RasterVertexOutput output;
11 output.texcoord = float2((vertexID << 1) & 2, vertexID & 2);
12 output.position = float4(output.texcoord * 2.0f - 1.0f, 0.0f, 1.0f);
13 output.position.y = -output.position.y;
14
15 return output;
16}
17
18struct PixelInput {
19 float4 position: SV_Position;
20 float2 texcoord : TEXCOORD0;
21};
22
23struct Bounds {
24 int2 origin;
25 int2 size;
26};
27
28Texture2D<float> t_layer : register(t0);
29SamplerState s_layer : register(s0);
30
31cbuffer GlyphLayerTextureParams : register(b0) {
32 Bounds bounds;
33 float4 run_color;
34 float4 gamma_ratios;
35 float grayscale_enhanced_contrast;
36 float3 _pad;
37};
38
39float4 emoji_rasterization_fragment(PixelInput input): SV_Target {
40 float sample = t_layer.Sample(s_layer, input.texcoord.xy).r;
41 float alpha_corrected = apply_contrast_and_gamma_correction(sample, run_color.rgb, grayscale_enhanced_contrast, gamma_ratios);
42 float alpha = alpha_corrected * run_color.a;
43 return float4(run_color.rgb * alpha, alpha);
44}
45