mirror of
https://github.com/rwengine/openrw.git
synced 2025-01-31 20:11:37 +01:00
Added simple alpha testing
This commit is contained in:
parent
db3fc6f2dd
commit
92c8f6a10c
@ -55,7 +55,7 @@ bool TextureLoader::loadFromMemory(char *data)
|
||||
uint8_t* coldata = reinterpret_cast<uint8_t*>(rootSection.raw() + sizeof(RW::BSSectionHeader) + sizeof(RW::BSTextureNative) + sizeof(RW::BSPaletteData) - 4);
|
||||
uint8_t fullColor[texNative.width * texNative.height * 4];
|
||||
|
||||
bool hasAlpha = (texNative.rasterformat & 0x0500) == 0x0500;
|
||||
bool hasAlpha = texNative.alpha == 1;
|
||||
|
||||
for(size_t j = 0; j < texNative.width * texNative.height; ++j)
|
||||
{
|
||||
|
@ -38,8 +38,9 @@ const char *fragmentShaderSource = "#version 130\n"
|
||||
"uniform sampler2D texture;"
|
||||
"void main()"
|
||||
"{"
|
||||
// " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);"
|
||||
" gl_FragColor = texture2D(texture, TexCoords);"
|
||||
" vec4 c = texture2D(texture, TexCoords);"
|
||||
" if(c.a < 0.9) discard;"
|
||||
" gl_FragColor = c;"
|
||||
"}";
|
||||
|
||||
GLuint uniModel, uniProj, uniView;
|
||||
|
Loading…
x
Reference in New Issue
Block a user