Beispiel #1
0
void ilG_heightmap_draw(ilG_heightmap *hm, il_mat mvp, il_mat imt)
{
    ilG_tex_bind(&hm->height, TEX_HEIGHT);
    ilG_tex_bind(&hm->normal, TEX_NORMAL);
    ilG_tex_bind(&hm->color, TEX_COLOR);
    ilG_mesh_bind(&hm->mesh);
    ilG_material *shader = ilG_renderman_findMaterial(hm->rm, hm->mat);
    ilG_material_bind(shader);
    ilG_material_bindMatrix(shader, hm->mvp, mvp);
    ilG_material_bindMatrix(shader, hm->imt, imt);
    glUniform2f(hm->size, (GLfloat)hm->w, (GLfloat)hm->h);
    ilG_mesh_draw(&hm->mesh);
}
Beispiel #2
0
static void heightmap_draw(void *ptr)
{
    ilG_testError("Unknown");
    ilG_heightmap *self = ptr;
    ilG_tex_bind(&self->height);
    ilG_tex_bind(&self->normal);
    ilG_tex_bind(&self->color);
    ilG_bindable_bind(&ilG_mesh_bindable, self->drawable);
    ilG_bindable_bind(&ilG_material_bindable, self->shader);
    for (unsigned i = 0; i < self->positionables.length; i++) {
        self->context->positionable = &self->positionables.data[i];
        ilG_bindable_action(&ilG_material_bindable, self->shader);
        ilG_bindable_action(&ilG_mesh_bindable, self->drawable);
    }
    ilG_testError("heightmap_draw");
}
 void draw(il_mat mvp, il_mat imt) {
     ilG_material *mat = ilG_renderman_findMaterial(rm, this->mat);
     ilG_material_bind(mat);
     ilG_mesh_bind(&mesh);
     ilG_tex_bind(&tex, 0);
     ilG_material_bindMatrix(mat, mvp_loc, mvp);
     ilG_material_bindMatrix(mat, imt_loc, imt);
     ilG_mesh_draw(&mesh);
 }