Exemplo n.º 1
0
void pass_positions::pass_process(float dt)
{
    EPS_STATE_SAMPLER_0(get_inputs().get_product());
    EPS_STATE_SAMPLER_1(get_inputs().get_slot(rendering::pass_input_slot::input_0));
    EPS_STATE_PROGRAM(program_process_.get_product());

    program_process_.uniform_value(utils::to_int(process_enum::u_positions), 0);
    program_process_.uniform_value(utils::to_int(process_enum::u_velocities), 1);
    program_process_.uniform_value(utils::to_int(process_enum::u_dt), dt);

    square_.render(program_process_, utils::to_int(process_enum::a_vertex_xy));
}
Exemplo n.º 2
0
void pass_fire::process(float)
{
    EPS_STATE_SAMPLER_0(get_inputs().get_slot(rendering::pass_input_slot::input_0));
    EPS_STATE_SAMPLER_1(texture_background_.get_product());
    EPS_STATE_PROGRAM(program_.get_product());

    program_.uniform_value(utils::to_int(program_enum::u_fire), 0);
    program_.uniform_value(utils::to_int(program_enum::u_background), 1);
    program_.uniform_value(utils::to_int(program_enum::u_texel), texel_);

    square_.render(program_, utils::to_int(program_enum::a_vertex_xy),
                             utils::to_int(program_enum::a_vertex_uv));
}
Exemplo n.º 3
0
void tone::process(float)
{
    EPS_STATE_SAMPLER_0(get_inputs().get_slot(pass_slot::slot_0));
    EPS_STATE_SAMPLER_1(get_inputs().get_slot(pass_slot::slot_1));
    EPS_STATE_PROGRAM(program_.get_product());

    program_.uniform_value(utils::to_int(program_enum::u_source_0), 0);
    program_.uniform_value(utils::to_int(program_enum::u_source_1), 1);
    program_.uniform_value(utils::to_int(program_enum::u_exposure), exposure_);
    program_.uniform_value(utils::to_int(program_enum::u_gamma), gamma_);

    square_.render(program_, utils::to_int(program_enum::a_vertex_xy),
                             utils::to_int(program_enum::a_vertex_uv));
}
Exemplo n.º 4
0
void pass_particles::process(float)
{
    EPS_STATE_BLEND(GL_SRC_ALPHA, GL_ONE);
    EPS_STATE_SAMPLER_0(get_inputs().get_slot(rendering::pass_slot::slot_0));
    EPS_STATE_SAMPLER_1(get_inputs().get_slot(rendering::pass_slot::slot_1));
    EPS_STATE_VERTICES(product_index_.get_product());
    EPS_STATE_PROGRAM(program_.get_product());

    program_.attribute_array_enable(utils::to_int(program_enum::a_product_uv));
    program_.attribute_array(utils::to_int(program_enum::a_product_uv), 0, 2, 0);
    program_.uniform_value(utils::to_int(program_enum::u_positions), 0);
    program_.uniform_value(utils::to_int(program_enum::u_velocities), 1);
    program_.uniform_value(utils::to_int(program_enum::u_color_speed_down), color_speed_down_);
    program_.uniform_value(utils::to_int(program_enum::u_color_speed_up), color_speed_up_);

    glDrawArrays(GL_POINTS, 0, product_index_.get_product_count());
}