Hallo liebe Community,
ich habe folgendes Problem, ich habe 2 Texturen die Objekte transparent darstellen sollen, die eine ist grün/rot, wo grün nicht transparent und rot transparent ist und die andere ist eine normale diffuse Texture die aber Aplha Kanäle hat.
So weit bin ich bis her gekommen:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8:
| float alphaBlending = transparencyTexture.a; float alphaMask = transparencyTexture.g; float alpha; if(alphaBlending < 1.0f) alpha = alphaBlending; else alpha = alphaMask; |
Nur das Problem ist, wenn der alphaBlending Wert 1.0f ist gehe ich von aus das es sich um alphaMask handelt aber es kann trozdem alphaBlending sein, z.b. ist der Pixel an dieser Stelle zwar 1.0f vom Alpha Wert aber ist braun, also wird das was eigentlich nicht transparent sein soll, halb transparent gemacht
Und bei meiner grün/rot Textur handelt es sich auch leider nicht um Transparent und nicht Transparent, sondern es kann auch mitteldinger geben.
Also wie finde ich heraus, ob meine Texture Alpha Blending oder Alpha Mask ist ?
Alles Liebe
SharinganShuriken
ps. Mein Grafik Engine Anbieter kann das sofort heruaserkennen ohne das ich einen Typ oder so einstellen muss!!!