Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7749175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:58:30+00:00 2026-06-01T10:58:30+00:00

I got some problem with texture transparency, I hope ya can help. Details: XNA

  • 0

I got some problem with texture transparency, I hope ya can help.

Details:

  • XNA 4.0
  • Texture source is BMP, what I make transparent by code:

    public void Feketealapú(string Azonosító)
    {
      //textúra megállapítása
      Texture2D Textúra = Textúrák[TextúraSzáma(Azonosító)];
    
      //adatok lekérése
      Color[] buffer = new Color[Textúra.Width * Textúra.Height];
      Textúra.GetData<Color>(buffer);
    
      //adatok módosítása
      for (int i = 0; i < buffer.Length; i++)
      {
        Color szín = buffer[i];
        szín.A = ((byte)((szín.R + szín.B + szín.G) / 3));
        buffer[i] = szín;
      }
    
      //adatok visszaírása
      Textúra.SetData<Color>(buffer);
    }
    
  • I use the following before I start drawing 3d stuff:

    public void Rajzolj()
    {
      GStatic.Játék.GrafikaiCsatorna.BlendState = BlendState.AlphaBlend;
      GStatic.Játék.GrafikaiCsatorna.DepthStencilState = DepthStencilState.Default;
      GStatic.Játék.GrafikaiCsatorna.RasterizerState = RasterizerState.CullCounterClockwise;
      GStatic.Játék.GrafikaiCsatorna.SamplerStates[0] = SamplerState.LinearWrap;
    

    ..etc.

  • If I use BlendState.Opaque I get no transparent textures.

  • I get into the following trouble: http://youtu.be/ZiPzyk7AWu8

  • Edit: Bit more detail about the problem is: the problem is with the transparent texture, what simulates a fire effect. The fire is from several rectangles with these transparent textures. If I see the fire from an angle, I should see another fire effect’s rectangle through the transparent texture, what is also transparent. The problem is that instead of this, I see the floor’s texture behind the model instead.

So could someone help me out a bit?

Thanks in advance:
Péter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:58:32+00:00Added an answer on June 1, 2026 at 10:58 am

    Never mind I don’t think the transparency is the issue. I think that whats happening is the first thing in the Z-Buffer is being draw and nothing else behind it.

    http://blogs.msdn.com/b/shawnhar/archive/2009/02/18/depth-sorting-alpha-blended-objects.aspx

    The most import part being the where he specifies how best to order your scene and manipulate the DepthBuffer.

    1. Set DepthBufferEnable and DepthBufferWriteEnable to true
    2. Draw all opaque geometry
    3. Leave DepthBufferEnable set to true, but change DepthBufferWriteEnable to false
    4. Sort alpha blended objects by distance from the camera, then draw them in order from back to front
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've got some problem with JS code. When i make array with object my
i got some problem and need help .. my plan : 1. get ip
I'm using Code First notation of Entity Framework, and got some problem after changing
i'm doing some code now and got some problem using restrict keyword. typedef int*
I got some problem on template.This code passed under vc6 but failed under g++.
I got some invalid Token parsing problem Code : public class viewparty extends Activity
I got some problem in JSONP result can somebody give me the idea how
I got some problem with my FSLex which I can't solve... All I know
I got some problem becouse i wanna give to generic interface a propertyInfo.Propertytype and
I have some problem with Jquery Autocomplete plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ ) I got it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.