Commit 707f59b8 authored by hybrid's avatar hybrid

Merged revisions 2530:2574 from 1.5 branch. Updated upgrade-guide.txt. Unified...

Merged revisions 2530:2574 from 1.5 branch. Updated upgrade-guide.txt. Unified point attenuation behavior. Removed wrong inlines.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2575 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 7f2a9860
...@@ -1584,3 +1584,61 @@ Changed parameter type (interpolation factor must not be int) ...@@ -1584,3 +1584,61 @@ Changed parameter type (interpolation factor must not be int)
vector2d<T> getInterpolated_quadratic(const vector2d<T>& v2, const vector2d<T>& v3, f64 d) const vector2d<T> getInterpolated_quadratic(const vector2d<T>& v2, const vector2d<T>& v3, f64 d) const
vector2d<T>& interpolate(const vector2d<T>& a, const vector2d<T>& b, f64 d) vector2d<T>& interpolate(const vector2d<T>& a, const vector2d<T>& b, f64 d)
Changes for Version 1.5.1
-------------------------
This release is a pure bugfixes release, with almost no visible API changes. All changes should be backward compatible (as it's just a minor release), but you have to recompile the app due to changes in the virtual method tables.
dimension2d.h
Fixed a bug in the operator+=, added operator-= and changed comparison to equal() method.
dimension2d<T>& operator-=(const dimension2d<T>& other)
IrrCompileConfig.h
Added defines to check for the Irrlicht version in the code.
IRRLICHT_VERSION_MAJOR
IRRLICHT_VERSION_MINOR
IRRLICHT_VERSION_REVISION
IRRLICHT_VERSION_SVN // only defined if you're using a version from SVN, i.e. not officially released one
IrrlichtDevice.h
Added static method isDriverSupported which checks the driver support of the library
static bool isDriverSupported(video::E_DRIVER_TYPE driver)
irrMath.h
Added iszero specialization for f64
bool iszero(const f64 a, const f64 tolerance = ROUNDING_ERROR_64)
irrXML.h
Added deleteCallback flag for cleanup of the ReadCallback.
IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback, bool deleteCallback = false);
IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback, bool deleteCallback = false);
IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback, bool deleteCallback = false);
ISceneNode.h
Added getSceneManager to get the currently used scene manager of the node.
ISceneManager* getSceneManager(void) const
IVideoDriver.h
Added default values for vType, pType, and iType
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const void* indexList, u32 primCount,
E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT)
Added method to draw 2d rectangle outline
void draw2DRectangleOutline(const core::recti& pos, SColor color=SColor(255,255,255,255))
matrix4.h
Added method to get transposedInverse
CMatrix4<T> transposedInverse(*this, EM4CONST_INVERSE_TRANSPOSED)
rect.h
Added typedefs
typedef rect<f32> rectf;
typedef rect<s32> recti;
SSharedMeshBuffer.h
Split hardware mapping hint into vertex and index part
E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX )
vector2d.h
Fix angle calculation for integer vectors
...@@ -577,21 +577,21 @@ void CNullDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, ...@@ -577,21 +577,21 @@ void CNullDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
//! draws an indexed triangle list //! draws an indexed triangle list
inline void CNullDriver::drawIndexedTriangleList(const S3DVertex* vertices, u32 vertexCount, const u16* indexList, u32 triangleCount) void CNullDriver::drawIndexedTriangleList(const S3DVertex* vertices, u32 vertexCount, const u16* indexList, u32 triangleCount)
{ {
drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT); drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);
} }
//! draws an indexed triangle list //! draws an indexed triangle list
inline void CNullDriver::drawIndexedTriangleList(const S3DVertex2TCoords* vertices, u32 vertexCount, const u16* indexList, u32 triangleCount) void CNullDriver::drawIndexedTriangleList(const S3DVertex2TCoords* vertices, u32 vertexCount, const u16* indexList, u32 triangleCount)
{ {
drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT); drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT);
} }
//! Draws an indexed triangle list. //! Draws an indexed triangle list.
inline void CNullDriver::drawIndexedTriangleList(const S3DVertexTangents* vertices, void CNullDriver::drawIndexedTriangleList(const S3DVertexTangents* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) u32 vertexCount, const u16* indexList, u32 triangleCount)
{ {
drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT); drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT);
...@@ -600,7 +600,7 @@ inline void CNullDriver::drawIndexedTriangleList(const S3DVertexTangents* vertic ...@@ -600,7 +600,7 @@ inline void CNullDriver::drawIndexedTriangleList(const S3DVertexTangents* vertic
//! Draws an indexed triangle fan. //! Draws an indexed triangle fan.
inline void CNullDriver::drawIndexedTriangleFan(const S3DVertex* vertices, void CNullDriver::drawIndexedTriangleFan(const S3DVertex* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) u32 vertexCount, const u16* indexList, u32 triangleCount)
{ {
drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT); drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
...@@ -609,7 +609,7 @@ inline void CNullDriver::drawIndexedTriangleFan(const S3DVertex* vertices, ...@@ -609,7 +609,7 @@ inline void CNullDriver::drawIndexedTriangleFan(const S3DVertex* vertices,
//! Draws an indexed triangle fan. //! Draws an indexed triangle fan.
inline void CNullDriver::drawIndexedTriangleFan(const S3DVertex2TCoords* vertices, void CNullDriver::drawIndexedTriangleFan(const S3DVertex2TCoords* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) u32 vertexCount, const u16* indexList, u32 triangleCount)
{ {
drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT); drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
...@@ -618,7 +618,7 @@ inline void CNullDriver::drawIndexedTriangleFan(const S3DVertex2TCoords* vertice ...@@ -618,7 +618,7 @@ inline void CNullDriver::drawIndexedTriangleFan(const S3DVertex2TCoords* vertice
//! Draws an indexed triangle fan. //! Draws an indexed triangle fan.
inline void CNullDriver::drawIndexedTriangleFan(const S3DVertexTangents* vertices, void CNullDriver::drawIndexedTriangleFan(const S3DVertexTangents* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) u32 vertexCount, const u16* indexList, u32 triangleCount)
{ {
drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT); drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
......
...@@ -128,7 +128,7 @@ namespace video ...@@ -128,7 +128,7 @@ namespace video
u32 vertexCount, const u16* indexList, u32 triangleCount); u32 vertexCount, const u16* indexList, u32 triangleCount);
//! Draws an indexed triangle fan. //! Draws an indexed triangle fan.
inline void drawIndexedTriangleFan(const S3DVertexTangents* vertices, virtual void drawIndexedTriangleFan(const S3DVertexTangents* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount); u32 vertexCount, const u16* indexList, u32 triangleCount);
//! Draws a 3d line. //! Draws a 3d line.
......
...@@ -1305,15 +1305,39 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun ...@@ -1305,15 +1305,39 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun
if (pType==scene::EPT_POINT_SPRITES && FeatureAvailable[IRR_ARB_point_sprite]) if (pType==scene::EPT_POINT_SPRITES && FeatureAvailable[IRR_ARB_point_sprite])
glEnable(GL_POINT_SPRITE_ARB); glEnable(GL_POINT_SPRITE_ARB);
#endif #endif
float quadratic[] = {0.0f, 0.0f, 10.01f};
extGlPointParameterfv(GL_POINT_DISTANCE_ATTENUATION_ARB, quadratic); // prepare size and attenuation (where supported)
float maxParticleSize=1.0f; GLfloat particleSize=Material.Thickness;
glGetFloatv(GL_POINT_SIZE_MAX_ARB, &maxParticleSize); // if (AntiAlias)
// maxParticleSize=maxParticleSize<Material.Thickness?maxParticleSize:Material.Thickness; // particleSize=core::clamp(particleSize, DimSmoothedPoint[0], DimSmoothedPoint[1]);
// extGlPointParameterf(GL_POINT_SIZE_MAX_ARB,maxParticleSize); // else
// extGlPointParameterf(GL_POINT_SIZE_MIN_ARB,Material.Thickness); particleSize=core::clamp(particleSize, DimAliasedPoint[0], DimAliasedPoint[1]);
extGlPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f); #if defined(GL_VERSION_1_4) || defined(GL_ARB_point_parameters) || defined(GL_EXT_point_parameters) || defined(GL_SGIS_point_parameters)
glPointSize(Material.Thickness); const float att[] = {1.0f, 1.0f, 0.0f};
#if defined(GL_VERSION_1_4)
extGlPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, att);
// extGlPointParameterf(GL_POINT_SIZE_MIN,1.f);
extGlPointParameterf(GL_POINT_SIZE_MAX, particleSize);
extGlPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE, 1.0f);
#elif defined(GL_ARB_point_parameters)
extGlPointParameterfv(GL_POINT_DISTANCE_ATTENUATION_ARB, att);
// extGlPointParameterf(GL_POINT_SIZE_MIN_ARB,1.f);
extGlPointParameterf(GL_POINT_SIZE_MAX_ARB, particleSize);
extGlPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 1.0f);
#elif defined(GL_EXT_point_parameters)
extGlPointParameterfv(GL_DISTANCE_ATTENUATION_EXT, att);
// extGlPointParameterf(GL_POINT_SIZE_MIN_EXT,1.f);
extGlPointParameterf(GL_POINT_SIZE_MAX_EXT, particleSize);
extGlPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_EXT, 1.0f);
#elif defined(GL_SGIS_point_parameters)
extGlPointParameterfv(GL_DISTANCE_ATTENUATION_SGIS, att);
// extGlPointParameterf(GL_POINT_SIZE_MIN_SGIS,1.f);
extGlPointParameterf(GL_POINT_SIZE_MAX_SGIS, particleSize);
extGlPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE_SGIS, 1.0f);
#endif
#endif
glPointSize(particleSize);
#ifdef GL_ARB_point_sprite #ifdef GL_ARB_point_sprite
if (pType==scene::EPT_POINT_SPRITES && FeatureAvailable[IRR_ARB_point_sprite]) if (pType==scene::EPT_POINT_SPRITES && FeatureAvailable[IRR_ARB_point_sprite])
glTexEnvf(GL_POINT_SPRITE_ARB,GL_COORD_REPLACE, GL_TRUE); glTexEnvf(GL_POINT_SPRITE_ARB,GL_COORD_REPLACE, GL_TRUE);
...@@ -2281,8 +2305,18 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -2281,8 +2305,18 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
// thickness // thickness
if (resetAllRenderStates || lastmaterial.Thickness != material.Thickness) if (resetAllRenderStates || lastmaterial.Thickness != material.Thickness)
{ {
glPointSize(material.Thickness); if (AntiAlias)
glLineWidth(material.Thickness); {
// glPointSize(core::clamp(static_cast<GLfloat>(material.Thickness), DimSmoothedPoint[0], DimSmoothedPoint[1]));
// we don't use point smoothing
glPointSize(core::clamp(static_cast<GLfloat>(material.Thickness), DimAliasedPoint[0], DimAliasedPoint[1]));
glLineWidth(core::clamp(static_cast<GLfloat>(material.Thickness), DimSmoothedLine[0], DimSmoothedLine[1]));
}
else
{
glPointSize(core::clamp(static_cast<GLfloat>(material.Thickness), DimAliasedPoint[0], DimAliasedPoint[1]));
glLineWidth(core::clamp(static_cast<GLfloat>(material.Thickness), DimAliasedLine[0], DimAliasedLine[1]));
}
} }
// Anti aliasing // Anti aliasing
......
...@@ -52,6 +52,14 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() : ...@@ -52,6 +52,14 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
{ {
for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i) for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i)
FeatureAvailable[i]=false; FeatureAvailable[i]=false;
DimAliasedLine[0]=1.f;
DimAliasedLine[1]=1.f;
DimAliasedPoint[0]=1.f;
DimAliasedPoint[1]=1.f;
DimSmoothedLine[0]=1.f;
DimSmoothedLine[1]=1.f;
DimSmoothedPoint[0]=1.f;
DimSmoothedPoint[1]=1.f;
} }
...@@ -442,6 +450,10 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -442,6 +450,10 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
MaxMultipleRenderTargets = static_cast<u8>(MaxUserClipPlanes); MaxMultipleRenderTargets = static_cast<u8>(MaxUserClipPlanes);
} }
#endif #endif
glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, DimAliasedLine);
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, DimAliasedPoint);
glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, DimSmoothedLine);
glGetFloatv(GL_SMOOTH_POINT_SIZE_RANGE, DimSmoothedPoint);
#if defined(GL_ARB_shading_language_100) || defined (GL_VERSION_2_0) #if defined(GL_ARB_shading_language_100) || defined (GL_VERSION_2_0)
if (FeatureAvailable[IRR_ARB_shading_language_100] || Version>=200) if (FeatureAvailable[IRR_ARB_shading_language_100] || Version>=200)
{ {
......
...@@ -804,6 +804,14 @@ class COpenGLExtensionHandler ...@@ -804,6 +804,14 @@ class COpenGLExtensionHandler
f32 MaxTextureLODBias; f32 MaxTextureLODBias;
//! Number of rendertargets available as MRTs //! Number of rendertargets available as MRTs
u8 MaxMultipleRenderTargets; u8 MaxMultipleRenderTargets;
//! Minimal and maximal supported thickness for lines without smoothing
GLfloat DimAliasedLine[2];
//! Minimal and maximal supported thickness for points without smoothing
GLfloat DimAliasedPoint[2];
//! Minimal and maximal supported thickness for lines with smoothing
GLfloat DimSmoothedLine[2];
//! Minimal and maximal supported thickness for points with smoothing
GLfloat DimSmoothedPoint[2];
//! OpenGL version as Integer: 100*Major+Minor, i.e. 2.1 becomes 201 //! OpenGL version as Integer: 100*Major+Minor, i.e. 2.1 becomes 201
u16 Version; u16 Version;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment