I was trying to save some texture from 3D rendering scene,and then get them to reuse.
The big problem is that rgb value can not match its alpha value.I need some picture without black edge,so I must use rgb colors to divide its alpha value(Image manipulation software such as Photoshop can just deal with picture which alpha channel is nonpremultiplied.)
Unfortunally,the color is too light that some result value are cut off to 1.
So I turned to a technique called premultiplied alpha.(See more). Instead of using shaders,I just use separate alpha calculation.
For example:RenderState.SourceBlend = Blend.SourceAlpha;
RenderState.DestinationBlend = Blend.InverseSourceAlpha;
Now I add some renderstate.RenderState.SourceBlendAlpha = Blend.One; RenderState.DestinationBlendAlpha = Blend.InverseSourceAlpha;
It works well.But when I try to handle following things:RenderState.SourceBlend = Blend.SourceAlpha;
RenderState.DestinationBlend = Blend.One;
RenderState.SourceBlendAlpha = Blend.One;
RenderState.DestinationBlendAlpha = Blend.One;
The result is totally wrong,can somebody tell me the reason?
PS:now I get the reason.When I use nonpremultiplied blend state,which is SourceAlpha and inverseSourceAlpha.The rgba value is definitely controlled within 0~1.But when I switch to
additive state,which is SourceAlpha and 1,the rgb values might be over one,thus cause the incorrect value.
Now my problem is how to control the alpha value,to make sure it keep all details and do not overflow at the same time?
Particle Blend Issue with premultiplied alpha
481 Views Asked by April At
0
There are 0 best solutions below
Related Questions in ALPHABLENDING
- Alpha blending using table lookup is not as fast as expected
- Alpha blending, transparence and z-ordering
- how to use alpha blending for android to blend 2 photos
- How to use opencv to acess images to use for alpha blending in java for android
- DirectX 9 + Shader Effect: disable a smooth transition of color
- Android - OpenGL-ES-2.0 alpha blending with ZOrderOnTop
- Why DirectX9 SDK example "Matrices" with Textured alpha blending showing black screen?
- Alpha Blend if Background Alpha is not 255/1.0f
- AlphaBlend in FireMonkey
- Point Sprite Alpha Blending
- How to use pre-multiplied during image convolution to solve alpha bleed problem?
- What is the simplest way to add an AlphaBlendValue property to Delphi's TImage
- Prevent a unit to be automatically added to the Uses clause?
- Why doesn't this D2006 code to fade a PNG Image work?
- Change Alpha Blend Mode in WPF?
Related Questions in DIRECT3D9
- Update a D3D9 texture from CUDA
- Deadlocks and crashes when debugging after upgrade to VS2012
- D3D9 HLSL Matrixed My Brain
- passing direct3d shader parameters dynamically
- Multiple Direct3D 9 devices and Alt-tabbing
- Full screen Direct3D9 device only displays at native resolution when second monitor is plugged in
- Direct3D9 BackBuffer to PixelArray
- How to implement antialiasing in DirectShow?
- How do I correctly implement texture pixel to texel correction in direct3d 9?
- Does direct3d initialize a newly created texture
- Copying data of a IDirect3DSurface to another IDirect3DSurface which are created with two directx devices
- Go to windowed mode in Direct3D 9
- Why would IDirect3DDevice9::Release return S_FALSE?
- Latencies of Direct3D 9 API calls
- Drawing targetting circle in 3d application
Related Questions in PARTICLES
- Unity - Particles emitting non-random
- SKEmitterNode particles lag at start
- How to play particles out of child
- Unity3D Play sound from particle
- How to draw each a vertex of a mesh as a circle
- how to make particles appear after collision
- How do I make confetti?
- Libgdx Particle2D looking weird
- Depth test with point sprite in OpenGL
- Absolute elements particles overlapping other elements issue
- Particles not Show in UI
- LibGDX particles do not show
- Change multiple materials in one GameObject in Unity3D
- I want to scale ParticleEffect - Libgdx
- Qt Quick 3D and Qt Quick Particles (Qt 5.3)
Related Questions in PREMULTIPLIED-ALPHA
- How to use pre-multiplied during image convolution to solve alpha bleed problem?
- How to mask an image with MetalPetal and output with transparency
- OpenGL and Camera Preview - premultiplied alpha - blending together gets “over saturated” color
- GLSL particle's rendering (premult)
- PNG Image with BGRA CgBI premultiplied alpha
- OpenGL ES 2.0 Alpha
- How to eliminate halo on blurred edge?
- Are images in ILC_COLOR32 image lists alpha premultiplied or not? I'm getting conflicting information
- How to handle alpha in a manual "Overlay" blend operation?
- FLV premultiplied alpha channel - adding to webpage as a swf?
- Convert PNG from premultiplied-alpha to conventional alpha transparancy?
- Multiplying every pixel by its alpha Open GLES 1.1 (premultiplication) & then reverse
- PIL - Prevent premultiplied alpha channel
- Draw a texture in OpenGL while ignoring its alpha channel
- How to use the TextureTool to create a PVR with premultiplied alpha?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?