Merged revisions 2477:2484 from 1.5 branch. Support for range fog under OpenGL. Cleaned up changes.txt.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2485 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-07-17 12:08:45 +00:00
parent 40a8a7a259
commit 94fe39af24
5 changed files with 437 additions and 554 deletions

File diff suppressed because it is too large Load Diff

View File

@ -823,8 +823,8 @@ namespace video
you want per-pixel fog.
\param rangeFog Set this to true to enable range-based vertex
fog. The distance from the viewer is used to compute the fog,
not the z-coordinate. This is better, but slower. This is only
available with D3D and vertex fog. */
not the z-coordinate. This is better, but slower. This might not
be available with all drivers and fog settings. */
virtual void setFog(SColor color=SColor(0,255,255,255),
E_FOG_TYPE fogType=EFT_FOG_LINEAR,
f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,

View File

@ -2721,7 +2721,6 @@ void COpenGLDriver::drawStencilShadowVolume(const core::vector3df* triangles, s3
}
void COpenGLDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftUpEdge,
video::SColor rightUpEdge, video::SColor leftDownEdge, video::SColor rightDownEdge)
{
@ -2788,10 +2787,20 @@ void COpenGLDriver::setFog(SColor c, E_FOG_TYPE fogType, f32 start,
CNullDriver::setFog(c, fogType, start, end, density, pixelFog, rangeFog);
glFogf(GL_FOG_MODE, GLfloat((fogType==EFT_FOG_LINEAR)? GL_LINEAR : (fogType==EFT_FOG_EXP)?GL_EXP:GL_EXP2));
#ifdef GL_EXT_fog_coord
if (FeatureAvailable[IRR_EXT_fog_coord])
glFogi(GL_FOG_COORDINATE_SOURCE, GL_FRAGMENT_DEPTH);
#endif
#ifdef GL_NV_fog_distance
if (FeatureAvailable[IRR_NV_fog_distance])
{
if (rangeFog)
glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV);
else
glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV);
}
#endif
if (fogType==EFT_FOG_LINEAR)
{
@ -2812,7 +2821,6 @@ void COpenGLDriver::setFog(SColor c, E_FOG_TYPE fogType, f32 start,
}
//! Draws a 3d line.
void COpenGLDriver::draw3DLine(const core::vector3df& start,
const core::vector3df& end, SColor color)

View File

@ -168,20 +168,6 @@ IAnimatedMesh* CSTLMeshFileLoader::createMesh(io::IReadFile* file)
}
//! Read RGB color
const c8* CSTLMeshFileLoader::readColor(const c8* bufPtr, video::SColor& color, const c8* const pBufEnd) const
{
const u32 COLOR_BUFFER_LENGTH = 16;
c8 colStr[COLOR_BUFFER_LENGTH];
color.setAlpha(255);
color.setRed((s32)(core::fast_atof(colStr) * 255.0f));
color.setGreen((s32)(core::fast_atof(colStr) * 255.0f));
color.setBlue((s32)(core::fast_atof(colStr) * 255.0f));
return bufPtr;
}
//! Read 3d vector of floats
void CSTLMeshFileLoader::getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const
{

View File

@ -7,7 +7,6 @@
#include "IMeshLoader.h"
#include "irrString.h"
#include "SColor.h"
#include "vector3d.h"
namespace irr
@ -39,8 +38,6 @@ private:
// skip to next printable character after the first line break
void goNextLine(io::IReadFile* file) const;
//! Read RGB color
const c8* readColor(const c8* pBufPtr, video::SColor& color, const c8* const pBufEnd) const;
//! Read 3d vector of floats
void getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const;
};