x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Alpha To Coverage - Oculus GO

Following a lot of experiments in removing aliasing in our Apps i noticed that a significant feature seems to be out of reach.

Alpha To Coverage working with Unity. Also recommended here by John Carmack..

Im looking for tips to enable an already working feature on PC Alpha to Coverage for Oculus Go and Android. I hope it solves the Problem that all my masked materials alias very significantly (such as foliage).

Product Version: UE 4.21
Tags:
more ▼

asked Jan 02 '19 at 12:43 PM in Rendering

avatar image

jinzay
88 6 14 20

avatar image FcGrreat May 28 '19 at 07:45 PM

could you find a solution?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Here is code i found deep on the Oculus Dev Platforms that allows us to enable Alpha 2 Coverage for Android! So no credits for me please. I updated it for 4.22

Important to note that it increases the cost of masked materials! And there is a Qualcomm forced dithering. It still looks way better, so for some of you it could make sense.

MobileBasePassPixelShader.usf

 Line 622
         OutColor.a = Opacity;
 
  Line 664     
         // CHANGE BEGIN
             #if MATERIALBLENDING_MASKED
                 #if OUTPUT_MOBILE_HDR
                     if (GetHDR32bppEncodeMode() != HDR_ENCODE_NONE) // FP16 HDR stores Z in framebuffer alpha
                 #endif
                 {
                     OutColor.a = GetMaterialMaskInputRaw(PixelMaterialInputs);
                 }
             #endif
         // CHANGE END

OpenGLCommands.ccp

 Line 1430
             if (RenderTargetBlendState.bAlphaBlendEnable)
             {
                 FOpenGL::EnableIndexed(GL_BLEND,RenderTargetIndex);
                 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); //CHANGE
             }
             else
             {
                 FOpenGL::DisableIndexed(GL_BLEND,RenderTargetIndex);
                 glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); //CHANGE
 

OpenGLDrv.cpp

 Line 620
         // Intel HD4000 under <= 10.8.4 requires GL_DITHER disabled or dithering will occur on any channel < 8bits.
         // No other driver does this but we don't need GL_DITHER on anyway.
         glDisable(GL_DITHER);
         
         glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); //CHANGE
     
         if (FOpenGL::SupportsFramebufferSRGBEnable())
         {
 
 
 

more ▼

answered Jul 09 '19 at 11:35 AM

avatar image

jinzay
88 6 14 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question