This is the texture loading bit
gl bind_texture 200
gl load_texture sprite.bmp
gl bind_texture 201
gl load_texture sprite-mask.bmp
This is what is executed each frame
gl enable GL_BLEND
gl disable GL_DEPTH_TEST
gl blend_func GL_DST_COLOR GL_ZERO
gl bind_texture 200
gl begin QUADS
gl tex_coord 0 0 | gl vertex -1.1 -1.1 0
gl tex_coord 1 0 | gl vertex 1.1 -1.1 0
gl tex_coord 1 1 | gl vertex 1.1 1.1 0
gl tex_coord 0 1 | gl vertex -1.1 1.1 0
gl end
gl blend_func GL_ONE GL_ONE
gl bind_texture 201
gl begin QUADS
gl tex_coord 0 0 | gl vertex -1.1 -1.1 0
gl tex_coord 1 0 | gl vertex 1.1 -1.1 0
gl tex_coord 1 1 | gl vertex 1.1 1.1 0
gl tex_coord 0 1 | gl vertex -1.1 1.1 0
gl end
gl enable GL_DEPTH_TEST
gl disable GL_BLEND
/source]
Masking
im having problems with masking, its only drawing the mask texture on the quad and not doing anything else. here''s my code for this bit.
Also, is the transparent part of this mask meant to be black or white? [it doesnt work with either anyway]
Here''s bits of my code that I used for the masking:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement