Original Post
🔒 Locked
how do i texture this?
Advertisement
Do you mean using something like photoshop to make the white parts transparent? (if so, use the magic wand to select everything that isn't white, make a new image with a transparent background and paste the stuff to that image)
Or do you mean using a shader? (do a test to see if the color value is white and if so set the alpha to 0)
Or do you mean using a shader? (do a test to see if the color value is white and if so set the alpha to 0)
You could set white as a color key if your graphics API can do that (makes the keyed color not drawn). Alternatively, you could open up the image in your favorite Photoshop-like program and flood-fill the background to transparent then save and use blending when you're drawing it.
No. I mean in OpenGL, using some kind of texture option, like one would use GL_LUMINANCE OR GL_RGB...
Simple answer is no.
It is probably easiest to use the GIMP or Photoshop to add an alpha layer (there are tools in those programs that will automatically convert white regions to transparency.
If you're using shaders, you could write a shader that would go transparent on white texels, or have alpha proportional to 1-(texel brightness).
Since you're using color, this next idea isn't really feasible, but you could re-do the image as two grayscale images (one for the grid, the other for the text) and pass in the format type GL_ALPHA to glTexImage2D(), but then white would mean visible and black would mean invisible ~ YMMV with this approach.
It is probably easiest to use the GIMP or Photoshop to add an alpha layer (there are tools in those programs that will automatically convert white regions to transparency.
If you're using shaders, you could write a shader that would go transparent on white texels, or have alpha proportional to 1-(texel brightness).
Since you're using color, this next idea isn't really feasible, but you could re-do the image as two grayscale images (one for the grid, the other for the text) and pass in the format type GL_ALPHA to glTexImage2D(), but then white would mean visible and black would mean invisible ~ YMMV with this approach.
Quote:
Original post by FreJa
No. I mean in OpenGL, using some kind of texture option, like one would use GL_LUMINANCE OR GL_RGB...
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Should give transparency based on the alpha value of the vertices.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement