diff --git a/contrib/src/rplight/pssmCameraRig.cxx b/contrib/src/rplight/pssmCameraRig.cxx index 8b8c22fd20..f9744e2129 100644 --- a/contrib/src/rplight/pssmCameraRig.cxx +++ b/contrib/src/rplight/pssmCameraRig.cxx @@ -369,8 +369,16 @@ void PSSMCameraRig::update(NodePath cam_node, const LVecBase3 &light_vector) { LMatrix4 transform = cam_node.get_transform()->get_mat(); // Get Camera and Lens pointers - Camera* cam = DCAST(Camera, cam_node.get_child(0).node()); - nassertv(cam != nullptr); + Camera *cam; + PandaNode *node = cam_node.node(); + if (node->is_of_type(Camera::get_class_type())) { + cam = (Camera *)node; + } + else { + // Perhaps we passed in something like base.camera ? + cam = DCAST(Camera, cam_node.get_child(0).node()); + nassertv(cam != nullptr); + } Lens* lens = cam->get_lens(); // Extract near and far points: diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 5c52cf86bf..adbd685f13 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -646,6 +646,7 @@ if (COMPILER == "MSVC"): else: LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib") IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR") + IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath") if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib") if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib") if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib") @@ -820,7 +821,7 @@ if (COMPILER=="GCC"): SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL") SmartPkgEnable("SQUISH", "", ("squish"), "squish.h") SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h") - SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h")) + SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h")) SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h")) SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h")) SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h")) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 86f4e89f3e..0e848d9c1a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -10013,7 +10013,8 @@ get_internal_image_format(Texture *tex, bool force_sized) const { bool is_3d = (texture_type == Texture::TT_3d_texture || texture_type == Texture::TT_2d_texture_array); - if (get_supports_compressed_texture_format(compression)) { + if (get_supports_compressed_texture_format(compression) && + texture_type != Texture::TT_buffer_texture) { switch (compression) { case Texture::CM_on: // The user asked for just generic compression. OpenGL supports @@ -13080,7 +13081,9 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { image_compression = tex->get_ram_image_compression(); } - if (!get_supports_compressed_texture_format(image_compression)) { + bool is_buffer_texture = tex->get_texture_type() == Texture::TT_buffer_texture; + if (is_buffer_texture || + !get_supports_compressed_texture_format(image_compression)) { image = tex->get_uncompressed_ram_image(); image_compression = Texture::CM_off; @@ -13098,7 +13101,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { // If we'll use immutable texture storage, we have to pick a sized image // format. bool force_sized = (gl_immutable_texture_storage && _supports_tex_storage) || - (tex->get_texture_type() == Texture::TT_buffer_texture); + (is_buffer_texture); GLint internal_format = get_internal_image_format(tex, force_sized); GLint external_format = get_external_image_format(tex); diff --git a/panda/src/gobj/geom.cxx b/panda/src/gobj/geom.cxx index afd11108c0..9fedfbaef1 100644 --- a/panda/src/gobj/geom.cxx +++ b/panda/src/gobj/geom.cxx @@ -805,6 +805,11 @@ make_lines_in_place() { #endif } + if (cdata->_primitive_type == PT_polygons || + cdata->_primitive_type == PT_patches) { + cdata->_primitive_type = PT_lines; + } + cdata->_modified = Geom::get_next_modified(); reset_geom_rendering(cdata); clear_cache_stage(current_thread); @@ -842,6 +847,10 @@ make_points_in_place() { #endif } + if (cdata->_primitive_type != PT_none) { + cdata->_primitive_type = PT_points; + } + cdata->_modified = Geom::get_next_modified(); reset_geom_rendering(cdata); clear_cache_stage(current_thread); @@ -879,6 +888,10 @@ make_patches_in_place() { #endif } + if (cdata->_primitive_type != PT_none) { + cdata->_primitive_type = PT_patches; + } + cdata->_modified = Geom::get_next_modified(); reset_geom_rendering(cdata); clear_cache_stage(current_thread); diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 8d4756fee4..d6c30296d9 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -5866,7 +5866,12 @@ do_consider_auto_process_ram_image(CData *cdata, bool generate_mipmaps, if (allow_compression && !driver_compress_textures) { CompressionMode compression = cdata->_compression; if (compression == CM_default && compressed_textures) { - compression = CM_on; + if (cdata->_texture_type == Texture::TT_buffer_texture) { + compression = CM_off; + } + else { + compression = CM_on; + } } if (compression != CM_off && cdata->_ram_image_compression == CM_off) { GraphicsStateGuardianBase *gsg = GraphicsStateGuardianBase::get_default_gsg(); @@ -7249,7 +7254,11 @@ do_set_quality_level(CData *cdata, Texture::QualityLevel quality_level) { bool Texture:: do_has_compression(const CData *cdata) const { if (cdata->_compression == CM_default) { - return compressed_textures; + if (cdata->_texture_type != Texture::TT_buffer_texture) { + return compressed_textures; + } else { + return false; + } } else { return (cdata->_compression != CM_off); } diff --git a/panda/src/pnmimagetypes/pnmFileTypeEXR.cxx b/panda/src/pnmimagetypes/pnmFileTypeEXR.cxx index 6d717579d9..6165241004 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeEXR.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypeEXR.cxx @@ -25,6 +25,10 @@ #include #include #include +#include +#include + +#include #ifndef IMATH_NAMESPACE #define IMATH_NAMESPACE Imath @@ -50,6 +54,15 @@ public: _strm.write(c, n); } +#if OPENEXR_VERSION_MAJOR >= 3 + virtual uint64_t tellp() { + return _strm.tellp(); + } + + virtual void seekp(uint64_t pos) { + _strm.seekp(pos); + } +#else virtual IMF::Int64 tellp() { return _strm.tellp(); } @@ -57,6 +70,7 @@ public: virtual void seekp(IMF::Int64 pos) { _strm.seekp(pos); } +#endif private: std::ostream &_strm; @@ -88,6 +102,15 @@ public: return not_eof; } +#if OPENEXR_VERSION_MAJOR >= 3 + virtual uint64_t tellg() { + return _strm.tellg(); + } + + virtual void seekg(uint64_t pos) { + _strm.seekg(pos); + } +#else virtual IMF::Int64 tellg() { return _strm.tellg(); } @@ -95,6 +118,7 @@ public: virtual void seekg(IMF::Int64 pos) { _strm.seekg(pos); } +#endif virtual void clear() { _strm.clear();