Autor Beitrag
SharinganShuriken
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Windows 7 Home Premium (64 Bit)
Visual Studio 2010 Professional, C# - SlimDX - Direct3D11
BeitragVerfasst: Mo 05.08.13 21:17 
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:

ausblenden 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!!!
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Mo 05.08.13 22:39 
Hast du mal einen Satz Beispieltexturen und was dann daraus werden soll? Das klingt irgendwie sehr obskur... 3 Alphakanäle?

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."