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
484 views Asked by April At
0
There are 0 answers
Related Questions in ALPHABLENDING
- Compositing ARGB Bitmaps Together CPU-only
- pixman_image_fill_boxes() does nothing
- Porter duff "conjoint" and "disjoint" use cases in vulkan
- Skia library not able to use alpha masking
- How overlay a image to specific part on another image in opencv
- Exact formula for alpha blending used in WPF
- Alpha Blend issue with python and opencl
- webgl2 problem with rendering opaque and translucent triangles
- Correct alpha blending parameters in a transparent MTKView?
- How to overlay images with alpha blending using AVX512 instructions?
- Processing sketch: merge alpha channel video with another movie
- Optimizing alpha blending for two colors with alpha
- Alpha Blending on Borders
- Math Formula for calculating the resulting colour of a transparent layer with a multiply blend over another layer
- Implementing Vector Addition Via `blendFunc` In WebGL?
Related Questions in DIRECT3D9
- How to implement antialiasing in DirectShow?
- How to create a Texture2D format YV12 (DXGI_FORMAT_420_OPAQUE)
- Direct3D9 does not work without display monitor or minimizing and locking the screen
- What is expected comparison between AlphaRef and AlphaValue in D3D9?
- Call GetDeviceCaps failed when remote desktop is minimized
- d3d9 how to register software device
- How can I reliably identify when Direct3D9 "device" maps onto which Windows GDI "monitor"?
- &D3DXVECTOR3 causes error C2102 '&' requires l-value
- Direct3D9 "Clear" Function Not Clearing
- How to handle Direct3D 9Ex D3DERR_DEVICEHUNG error?
- Direct3D9 not drawing?
- How to perform alpha blending on saved raw argb videos(a image and a video will also work) using direct3d9 , direct3d10 or direct3d11?
- Direct3D 9 Z-Buffer Precision Bug occuring only in release build
- What is a data stream in DirectX 9?
- Get SharpDXException Invalid Parameters when try to create a new Texture for DirectX 9 on 32bit NVidia Quadro M1000M
Related Questions in PARTICLES
- Changing the theme of Particles component(react tsparticles library) dynamically
- My Particle filter is not providing approx parameters of the model
- How to setup particles from CPUParticles3D to collide with a plane/ground
- Particle in a Box not moving
- Need to disable prerasterization so that all fragments (gl_PrimitiveID) are processed
- Watershed adjustment for broken particles
- Unity3D, How sort layer rendering
- How to smoothen particle motion in plain JS
- How to use std::sort to loop through one variable within a struct and rearrange another?
- Are there methods to detect collisions between spheres in simulations with large time steps?
- How to simulate bimodal disitribution with already known D90, D50 and D10?
- ng-particle options signature not miss matched Error
- How to make object rotate from the base in unity
- tsParticles hexagons preset is not working properly
- I'm trying to animate a horizontal line moving down
Related Questions in PREMULTIPLIED-ALPHA
- webgl2 with premultipliedAlpha:false and unwanted edges
- Issue with redrawing premultiplied alpha bitmap with Win32 GDI
- Merge a pre-multiplied pixel into a canvas with non-pre-multiplied pixels, controlling the intensity
- Render premultiplied data to transparent PNG file in Java
- Premultiplied alpha and multisampling in OpenGL
- How to mask an image with MetalPetal and output with transparency
- How to eliminate halo on blurred edge?
- Convert a CGImage to MTLTexture without premultiplication
- Why does not using premultiplied alpha have "significantly worse performance"?
- Disable premultiplied alpha on Bitmap.compress
- How to cause .NET to save a TIFF in PARGB32 format?
- PIL - Prevent premultiplied alpha channel
- math formula for color and alpha in webgl
- OpenGL ES 2.0 Alpha
- Dark halo around partial transparent parts of images in opengl
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?
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)