mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 07:56:40 +00:00 
			
		
		
		
	Adapt destination alpha factor for AMD
As discussed in the comment, it's unclear to me whether this is a driver bug or mandatory behaviour only AMD implement. Some more context is here: https://gitlab.com/OpenMW/openmw/-/issues/6119#note_618245903
This commit is contained in:
		
							parent
							
								
									0e57622bbe
								
							
						
					
					
						commit
						e42b3bf960
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2011,6 +2011,11 @@ namespace NifOsg
 | 
			
		|||
                    {
 | 
			
		||||
                        osg::ref_ptr<osg::BlendFunc> blendFunc (new osg::BlendFunc(getBlendMode((alphaprop->flags>>1)&0xf),
 | 
			
		||||
                                                                                   getBlendMode((alphaprop->flags>>5)&0xf)));
 | 
			
		||||
                        // on AMD hardware, alpha still seems to be stored with an RGBA framebuffer with OpenGL.
 | 
			
		||||
                        // This might be mandated by the OpenGL 2.1 specification section 2.14.9, or might be a bug.
 | 
			
		||||
                        // Either way, D3D8.1 doesn't do that, so adapt the destination factor.
 | 
			
		||||
                        if (blendFunc->getDestination() == GL_DST_ALPHA)
 | 
			
		||||
                            blendFunc->setDestination(GL_ONE);
 | 
			
		||||
                        blendFunc = shareAttribute(blendFunc);
 | 
			
		||||
                        stateset->setAttributeAndModes(blendFunc, osg::StateAttribute::ON);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue