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 7745971
In Process

The Archive Base Latest Questions

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

I have a surface (OffScreenPlain or RenderTarget with D3DFMT_A8R8G8B8) which I copy pixels (ARGB)

  • 0

I have a surface (OffScreenPlain or RenderTarget with D3DFMT_A8R8G8B8) which I copy pixels (ARGB) to, from a third party function. Before pixel copying, Bits are accessed by LockRect.

This surface is then StretchRect to the Backbuffer which is (D3DFMT_A8R8G8B8). Surface and Backbuffer are different dimensions. Filtering is set to D3DTEXF_NONE.

Just after creating the d3d device I’ve set following RenderState settings

D3DRS_ALPHABLENDENABLE -> TRUE
D3DRS_BLENDOP          -> D3DBLENDOP_ADD
D3DRS_SRCBLEND         -> D3DBLEND_SRCALPHA
D3DRS_DESTBLEND        -> D3DBLEND_INVSRCALPHA

But I see no alpha blending happening. I’ve verified that alpha is specified in pixels.

I’ve done a simple test by creating a vertex buffer and drawing a triangle (DrawPrimitive) which displays with alpha blending.

In this test surface was StretchRect first and then DrawPrimitive, and the surface content displays without alpha blending and the triangle displays with alpha blending.

What am I missing here? Thanks

  • 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:09:30+00:00Added an answer on June 1, 2026 at 10:09 am

    States that you mentioned affect vertexes only. In order to have textures blended correctly you need to specify how texture alpha is blended with vertexes one. You do this like this:

    d3ddevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
    d3ddevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
    d3ddevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
    

    By default ALPHAOP is SELECTARG1, i.e. only texture alpha is considered in rendering.

    Another solution is using ID3DXSprite::Draw method for copying texture to the back buffer. Just pass color D3DCOLOR_ARGB(X, 255, 255, 255) where X is your alpha. This method will do all the states adjustments and final result will match your expectations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a collection of points which describe the surface of a shape that
I have managed to make a surface from a set point points in vtk.
I have a glutSolidTeapot (which has its surface normals generated automatically according to opengl.org)
I have seen 3d surface plots of data before but i do not know
I have a small python VTK function that calculates the volume and surface area
Say I have p nodes on a n by m pixel 2D surface, I
I have the following datatable, which has Units information. The Units have a surface
I am developing a game.I have drawn images on a surface view which is
I have a 3D surface, (think about the xy plane). The plane can be
I have defined 2 points on the surface of a sphere using spherical coordinates.

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.