Esempio n. 1
0
void EffectRepository::CreateSkyEffect(LowLevelGraphics* lowLevelGraphics, const string& absoluteFilepath) {
    Effect* effect = new Effect(lowLevelGraphics->GetDevice(), absoluteFilepath);

    D3D11_INPUT_ELEMENT_DESC desc[] = {
        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, Mesh::GeometryChannelSlot, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
    };

    effect->CreateInputLayout(lowLevelGraphics->GetDevice(), "sky", "gradient", "pass0", desc, _countof(desc));
    effect->CreateInputLayout(lowLevelGraphics->GetDevice(), "sky", "skybox", "pass0", desc, _countof(desc));
    effects[absoluteFilepath] = effect;
}
Esempio n. 2
0
void EffectRepository::CreateWaterEffect(LowLevelGraphics* lowLevelGraphics, const string& absoluteFilepath) {
    Effect* effect = new Effect(lowLevelGraphics->GetDevice(), absoluteFilepath);

    D3D11_INPUT_ELEMENT_DESC desc[] = {
        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, Mesh::GeometryChannelSlot, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, Mesh::TextureChannelSlot, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }
    };

    effect->CreateInputLayout(lowLevelGraphics->GetDevice(), "water", "forward", "pass0", desc, _countof(desc));
    effects[absoluteFilepath] = effect;
}
Esempio n. 3
0
void EffectRepository::CreateSpriteEffect(LowLevelGraphics* lowLevelGraphics, const string& absoluteFilepath) {
    Effect* effect = new Effect(lowLevelGraphics->GetDevice(), absoluteFilepath);
    D3D11_INPUT_ELEMENT_DESC desc[] = {
        { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, Mesh::GeometryChannelSlot, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, Mesh::TextureChannelSlot, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
        { "TRANSFORM", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, Mesh::InstanceChannelSlot, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 },
        { "TRANSFORM", 1, DXGI_FORMAT_R32G32B32A32_FLOAT, Mesh::InstanceChannelSlot, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_INSTANCE_DATA, 1 },
        { "TRANSFORM", 2, DXGI_FORMAT_R32G32B32A32_FLOAT, Mesh::InstanceChannelSlot, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_INSTANCE_DATA, 1 },
        { "TRANSFORM", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, Mesh::InstanceChannelSlot, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_INSTANCE_DATA, 1 },
        { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, Mesh::InstanceChannelSlot, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_INSTANCE_DATA, 1 },
    };
    effect->CreateInputLayout(lowLevelGraphics->GetDevice(), "sprite", "instancing", "pass0", desc, _countof(desc));

    effects[absoluteFilepath] = effect;
}