Parcourir la source

Merge branch 'release/1.10.x'

rdb il y a 5 ans
Parent
commit
8486d286b7

+ 1 - 1
makepanda/installer.nsi

@@ -229,7 +229,7 @@ SectionGroup "Panda3D Libraries"
         SetDetailsPrint listonly
         SetDetailsPrint listonly
 
 
         SetOutPath $INSTDIR\models
         SetOutPath $INSTDIR\models
-        File /r /x CVS "${BUILT}\models\*"
+        File /nonfatal /r /x CVS "${BUILT}\models\*"
 
 
         SetDetailsPrint both
         SetDetailsPrint both
         DetailPrint "Installing optional components..."
         DetailPrint "Installing optional components..."

+ 1 - 1
panda/src/glstuff/glCgShaderContext_src.cxx

@@ -166,7 +166,7 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte
             if (cgGetParameterSemantic(p)) {
             if (cgGetParameterSemantic(p)) {
               GLCAT.error(false) << " : " << cgGetParameterSemantic(p);
               GLCAT.error(false) << " : " << cgGetParameterSemantic(p);
             }
             }
-            GLCAT.error(false) << " should be declared as float4, not float3!\n";
+            GLCAT.error(false) << " should be declared as float3, not float4!\n";
           }
           }
           break;
           break;
         case 3:  // gl_Color
         case 3:  // gl_Color

+ 18 - 4
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -9764,15 +9764,22 @@ get_external_image_format(Texture *tex) const {
 
 
   case Texture::F_rgba:
   case Texture::F_rgba:
   case Texture::F_rgbm:
   case Texture::F_rgbm:
-  case Texture::F_rgba4:
-  case Texture::F_rgba5:
   case Texture::F_rgba8:
   case Texture::F_rgba8:
   case Texture::F_rgba12:
   case Texture::F_rgba12:
+    return _supports_bgr ? GL_BGRA : GL_RGBA;
+
+  case Texture::F_rgba4:
+  case Texture::F_rgba5:
   case Texture::F_rgba16:
   case Texture::F_rgba16:
   case Texture::F_rgba32:
   case Texture::F_rgba32:
   case Texture::F_srgb_alpha:
   case Texture::F_srgb_alpha:
   case Texture::F_rgb10_a2:
   case Texture::F_rgb10_a2:
+#ifdef OPENGLES
+    // OpenGL ES doesn't have sized BGRA formats.
+    return GL_RGBA;
+#else
     return _supports_bgr ? GL_BGRA : GL_RGBA;
     return _supports_bgr ? GL_BGRA : GL_RGBA;
+#endif
 
 
   case Texture::F_luminance:
   case Texture::F_luminance:
 #ifdef OPENGLES
 #ifdef OPENGLES
@@ -10293,9 +10300,9 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
 
 
 #ifdef OPENGLES
 #ifdef OPENGLES
   case Texture::F_rgba8:
   case Texture::F_rgba8:
-    return GL_RGBA8_OES;
+    return _supports_bgr ? GL_BGRA : GL_RGBA8_OES;
   case Texture::F_rgba12:
   case Texture::F_rgba12:
-    return force_sized ? GL_RGBA8 : GL_RGBA;
+    return _supports_bgr ? GL_BGRA : (force_sized ? GL_RGBA8 : GL_RGBA);
 #else
 #else
   case Texture::F_rgba8:
   case Texture::F_rgba8:
     if (Texture::is_unsigned(tex->get_component_type())) {
     if (Texture::is_unsigned(tex->get_component_type())) {
@@ -13785,7 +13792,11 @@ upload_simple_texture(CLP(TextureContext) *gtc) {
   Texture *tex = gtc->get_texture();
   Texture *tex = gtc->get_texture();
   nassertr(tex != nullptr, false);
   nassertr(tex != nullptr, false);
 
 
+#ifdef OPENGLES
+  GLenum internal_format = GL_BGRA;
+#else
   GLenum internal_format = GL_RGBA;
   GLenum internal_format = GL_RGBA;
+#endif
   GLenum external_format = GL_BGRA;
   GLenum external_format = GL_BGRA;
 
 
   const unsigned char *image_ptr = tex->get_simple_ram_image();
   const unsigned char *image_ptr = tex->get_simple_ram_image();
@@ -13799,6 +13810,9 @@ upload_simple_texture(CLP(TextureContext) *gtc) {
     // If the GL doesn't claim to support BGR, we may have to reverse the
     // If the GL doesn't claim to support BGR, we may have to reverse the
     // component ordering of the image.
     // component ordering of the image.
     external_format = GL_RGBA;
     external_format = GL_RGBA;
+#ifdef OPENGLES
+    internal_format = GL_RGBA;
+#endif
     image_ptr = fix_component_ordering(bgr_image, image_ptr, image_size,
     image_ptr = fix_component_ordering(bgr_image, image_ptr, image_size,
                                        external_format, tex);
                                        external_format, tex);
   }
   }

+ 3 - 1
panda/src/pgraphnodes/shaderGenerator.cxx

@@ -1094,7 +1094,9 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
     text << "\t uniform float4 clipplane_" << i << ",\n";
     text << "\t uniform float4 clipplane_" << i << ",\n";
   }
   }
 
 
-  text << "\t uniform float4 attr_ambient,\n";
+  if (key._lighting) {
+    text << "\t uniform float4 attr_ambient,\n";
+  }
   text << "\t uniform float4 attr_colorscale\n";
   text << "\t uniform float4 attr_colorscale\n";
   text << ") {\n";
   text << ") {\n";