view Engine/Graphics/Shaders/UI.hlsl @ 2541:a902abdfc7f2

1. Renamed class Game to class Engine. 2. Separated game logic as state of FSM from game logic as engine. 3. Found out that many UI screen initializers were optimized away, intially they all returned newly created window as separate object like it is done in CharacterUI_Initialize.
author a.parshin
date Sun, 10 May 2015 01:29:11 +0200
parents c7264ab7132f
children
line wrap: on
line source

cbuffer fast: register(b0)
{
    float2 position : packoffset(c0.x);
    float2 size     : packoffset(c0.z);
};

cbuffer slow: register(b1)
{
};


struct VInput
{
    float4 pos: POSITION0;
};

struct VOutput
{
    float4 pos: SV_Position0;
    float2 uv:  TEXCOORD0;
};


VOutput vs(VInput vin)
{
    VOutput vout;

    float2 normalized_pos = vin.pos.xy * position.xy + vin.pos.zw * size.xy;
    vout.pos.xy = float2(2, -2) * normalized_pos + float2(-1, 1);
    vout.pos.zw = float2(0, 1);
    vout.uv = vin.pos.zw;

    return vout;
}




SamplerState      basic_sampler: register(s0);
Texture2D<float4> image: register(t0);

float4 main(VOutput pin): SV_Target0
{
    return image.Sample(basic_sampler, pin.uv);
}