Commit 94fe39af authored by hybrid's avatar hybrid

Merged revisions 2477:2484 from 1.5 branch. Support for range fog under...

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
parent 40a8a7a2
This diff is collapsed.
...@@ -823,8 +823,8 @@ namespace video ...@@ -823,8 +823,8 @@ namespace video
you want per-pixel fog. you want per-pixel fog.
\param rangeFog Set this to true to enable range-based vertex \param rangeFog Set this to true to enable range-based vertex
fog. The distance from the viewer is used to compute the fog, fog. The distance from the viewer is used to compute the fog,
not the z-coordinate. This is better, but slower. This is only not the z-coordinate. This is better, but slower. This might not
available with D3D and vertex fog. */ be available with all drivers and fog settings. */
virtual void setFog(SColor color=SColor(0,255,255,255), virtual void setFog(SColor color=SColor(0,255,255,255),
E_FOG_TYPE fogType=EFT_FOG_LINEAR, E_FOG_TYPE fogType=EFT_FOG_LINEAR,
f32 start=50.0f, f32 end=100.0f, f32 density=0.01f, f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,
......
...@@ -2721,7 +2721,6 @@ void COpenGLDriver::drawStencilShadowVolume(const core::vector3df* triangles, s3 ...@@ -2721,7 +2721,6 @@ void COpenGLDriver::drawStencilShadowVolume(const core::vector3df* triangles, s3
} }
void COpenGLDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftUpEdge, void COpenGLDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftUpEdge,
video::SColor rightUpEdge, video::SColor leftDownEdge, video::SColor rightDownEdge) video::SColor rightUpEdge, video::SColor leftDownEdge, video::SColor rightDownEdge)
{ {
...@@ -2788,10 +2787,20 @@ void COpenGLDriver::setFog(SColor c, E_FOG_TYPE fogType, f32 start, ...@@ -2788,10 +2787,20 @@ void COpenGLDriver::setFog(SColor c, E_FOG_TYPE fogType, f32 start,
CNullDriver::setFog(c, fogType, start, end, density, pixelFog, rangeFog); 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)); glFogf(GL_FOG_MODE, GLfloat((fogType==EFT_FOG_LINEAR)? GL_LINEAR : (fogType==EFT_FOG_EXP)?GL_EXP:GL_EXP2));
#ifdef GL_EXT_fog_coord #ifdef GL_EXT_fog_coord
if (FeatureAvailable[IRR_EXT_fog_coord]) if (FeatureAvailable[IRR_EXT_fog_coord])
glFogi(GL_FOG_COORDINATE_SOURCE, GL_FRAGMENT_DEPTH); glFogi(GL_FOG_COORDINATE_SOURCE, GL_FRAGMENT_DEPTH);
#endif #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) if (fogType==EFT_FOG_LINEAR)
{ {
...@@ -2812,7 +2821,6 @@ void COpenGLDriver::setFog(SColor c, E_FOG_TYPE fogType, f32 start, ...@@ -2812,7 +2821,6 @@ void COpenGLDriver::setFog(SColor c, E_FOG_TYPE fogType, f32 start,
} }
//! Draws a 3d line. //! Draws a 3d line.
void COpenGLDriver::draw3DLine(const core::vector3df& start, void COpenGLDriver::draw3DLine(const core::vector3df& start,
const core::vector3df& end, SColor color) const core::vector3df& end, SColor color)
......
...@@ -168,20 +168,6 @@ IAnimatedMesh* CSTLMeshFileLoader::createMesh(io::IReadFile* 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 //! Read 3d vector of floats
void CSTLMeshFileLoader::getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const void CSTLMeshFileLoader::getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const
{ {
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "IMeshLoader.h" #include "IMeshLoader.h"
#include "irrString.h" #include "irrString.h"
#include "SColor.h"
#include "vector3d.h" #include "vector3d.h"
namespace irr namespace irr
...@@ -39,8 +38,6 @@ private: ...@@ -39,8 +38,6 @@ private:
// skip to next printable character after the first line break // skip to next printable character after the first line break
void goNextLine(io::IReadFile* file) const; 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 //! Read 3d vector of floats
void getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const; void getNextVector(io::IReadFile* file, core::vector3df& vec, bool binary) const;
}; };
......
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