Loading...
Searching...
No Matches
IQ3Shader.h
Go to the documentation of this file.
// Copyright (C) 2006-2012 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_Q3_LEVEL_SHADER_H_INCLUDED__
#define __I_Q3_LEVEL_SHADER_H_INCLUDED__
#include "irrArray.h"
#include "fast_atof.h"
#include "IFileSystem.h"
#include "IVideoDriver.h"
#include "coreutil.h"
namespace irr
{
namespace scene
{
namespace quake3
{
static core::stringc irrEmptyStringc("");
enum eQ3MeshIndex
{
E_Q3_MESH_GEOMETRY = 0,
E_Q3_MESH_ITEMS,
E_Q3_MESH_BILLBOARD,
E_Q3_MESH_FOG,
E_Q3_MESH_UNRESOLVED,
E_Q3_MESH_SIZE
};
struct Q3LevelLoadParameter
{
Q3LevelLoadParameter ()
:defaultLightMapMaterial ( video::EMT_LIGHTMAP_M4 ),
defaultModulate ( video::EMFN_MODULATE_4X ),
defaultFilter ( video::EMF_BILINEAR_FILTER ),
patchTesselation ( 8 ),
verbose ( 0 ),
startTime ( 0 ), endTime ( 0 ),
mergeShaderBuffer ( 1 ),
cleanUnResolvedMeshes ( 1 ),
loadAllShaders ( 0 ),
loadSkyShader ( 0 ),
alpharef ( 1 ),
swapLump ( 0 ),
#ifdef __BIG_ENDIAN__
swapHeader ( 1 )
#else
swapHeader ( 0 )
#endif
{
memcpy ( scriptDir, "scripts\x0", 8 );
}
video::E_MATERIAL_TYPE defaultLightMapMaterial;
video::E_MODULATE_FUNC defaultModulate;
video::E_MATERIAL_FLAG defaultFilter;
s32 patchTesselation;
s32 verbose;
u32 startTime;
u32 endTime;
s32 mergeShaderBuffer;
s32 cleanUnResolvedMeshes;
s32 loadAllShaders;
s32 loadSkyShader;
s32 alpharef;
s32 swapLump;
s32 swapHeader;
c8 scriptDir [ 64 ];
};
// some useful typedefs
typedef core::array< core::stringc > tStringList;
typedef core::array< video::ITexture* > tTexArray;
// string helper.. TODO: move to generic files
inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 *list[], u16 listSize )
{
const char * in = string.c_str () + pos;
for ( u16 i = 0; i != listSize; ++i )
{
if (string.size() < pos)
return -2;
u32 len = (u32) strlen ( list[i] );
if (string.size() < pos+len)
continue;
if ( in [len] != 0 && in [len] != ' ' )
continue;
if ( strncmp ( in, list[i], len ) )
continue;
pos += len + 1;
return (s16) i;
}
return -2;
}
inline f32 getAsFloat ( const core::stringc &string, u32 &pos )
{
const char * in = string.c_str () + pos;
f32 value = 0.f;
pos += (u32) ( core::fast_atof_move ( in, value ) - in ) + 1;
return value;
}
inline core::vector3df getAsVector3df ( const core::stringc &string, u32 &pos )
{
core::vector3df v;
v.X = getAsFloat ( string, pos );
v.Z = getAsFloat ( string, pos );
v.Y = getAsFloat ( string, pos );
return v;
}
/*
extract substrings
*/
inline void getAsStringList ( tStringList &list, s32 max, const core::stringc &string, u32 &startPos )
{
list.clear ();
s32 finish = 0;
s32 endPos;
do
{
endPos = string.findNext ( ' ', startPos );
if ( endPos == -1 )
{
finish = 1;
endPos = string.size();
}
list.push_back ( string.subString ( startPos, endPos - startPos ) );
startPos = endPos + 1;
if ( list.size() >= (u32) max )
finish = 1;
} while ( !finish );
}
struct SBlendFunc
{
SBlendFunc ( video::E_MODULATE_FUNC mod )
: type ( video::EMT_SOLID ), modulate ( mod ),
param0( 0.f ),
isTransparent ( 0 ) {}
video::E_MATERIAL_TYPE type;
video::E_MODULATE_FUNC modulate;
f32 param0;
u32 isTransparent;
};
// parses the content of Variable cull
inline bool getCullingFunction ( const core::stringc &cull )
{
if ( cull.size() == 0 )
return true;
bool ret = true;
static const c8 * funclist[] = { "none", "disable", "twosided" };
u32 pos = 0;
switch ( isEqual ( cull, pos, funclist, 3 ) )
{
case 0:
case 1:
case 2:
ret = false;
break;
}
return ret;
}
// parses the content of Variable depthfunc
// return a z-test
inline u8 getDepthFunction ( const core::stringc &string )
{
u8 ret = video::ECFN_LESSEQUAL;
if ( string.size() == 0 )
return ret;
static const c8 * funclist[] = { "lequal","equal" };
u32 pos = 0;
switch ( isEqual ( string, pos, funclist, 2 ) )
{
case 0:
ret = video::ECFN_LESSEQUAL;
break;
case 1:
ret = video::ECFN_EQUAL;
break;
}
return ret;
}
inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc )
{
if ( string.size() == 0 )
return;
// maps to E_BLEND_FACTOR
static const c8 * funclist[] =
{
"gl_zero",
"gl_one",
"gl_dst_color",
"gl_one_minus_dst_color",
"gl_src_color",
"gl_one_minus_src_color",
"gl_src_alpha",
"gl_one_minus_src_alpha",
"gl_dst_alpha",
"gl_one_minus_dst_alpha",
"gl_src_alpha_sat",
"add",
"filter",
"blend",
"ge128",
"gt0",
};
u32 pos = 0;
s32 srcFact = isEqual ( string, pos, funclist, 16 );
if ( srcFact < 0 )
return;
u32 resolved = 0;
s32 dstFact = isEqual ( string, pos, funclist, 16 );
switch ( srcFact )
{
case video::EBF_ZERO:
switch ( dstFact )
{
// gl_zero gl_src_color == gl_dst_color gl_zero
case video::EBF_SRC_COLOR:
blendfunc.type = video::EMT_ONETEXTURE_BLEND;
blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate );
blendfunc.isTransparent = 1;
resolved = 1;
break;
} break;
case video::EBF_ONE:
switch ( dstFact )
{
// gl_one gl_zero
case video::EBF_ZERO:
blendfunc.type = video::EMT_SOLID;
blendfunc.isTransparent = 0;
resolved = 1;
break;
// gl_one gl_one
case video::EBF_ONE:
blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
blendfunc.isTransparent = 1;
resolved = 1;
break;
} break;
case video::EBF_SRC_ALPHA:
switch ( dstFact )
{
// gl_src_alpha gl_one_minus_src_alpha
case video::EBF_ONE_MINUS_SRC_ALPHA:
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.param0 = 1.f/255.f;
blendfunc.isTransparent = 1;
resolved = 1;
break;
} break;
case 11:
// add
blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
blendfunc.isTransparent = 1;
resolved = 1;
break;
case 12:
// filter = gl_dst_color gl_zero or gl_zero gl_src_color
blendfunc.type = video::EMT_ONETEXTURE_BLEND;
blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate );
blendfunc.isTransparent = 1;
resolved = 1;
break;
case 13:
// blend = gl_src_alpha gl_one_minus_src_alpha
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.param0 = 1.f/255.f;
blendfunc.isTransparent = 1;
resolved = 1;
break;
case 14:
// alphafunc ge128
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.param0 = 0.5f;
blendfunc.isTransparent = 1;
resolved = 1;
break;
case 15:
// alphafunc gt0
blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
blendfunc.param0 = 1.f / 255.f;
blendfunc.isTransparent = 1;
resolved = 1;
break;
}
// use the generic blender
if ( 0 == resolved )
{
blendfunc.type = video::EMT_ONETEXTURE_BLEND;
blendfunc.param0 = video::pack_textureBlendFunc (
(video::E_BLEND_FACTOR) srcFact,
(video::E_BLEND_FACTOR) dstFact,
blendfunc.modulate);
blendfunc.isTransparent = 1;
}
}
// random noise [-1;1]
struct Noiser
{
static f32 get ()
{
static u32 RandomSeed = 0x69666966;
RandomSeed = (RandomSeed * 3631 + 1);
f32 value = ( (f32) (RandomSeed & 0x7FFF ) * (1.0f / (f32)(0x7FFF >> 1) ) ) - 1.f;
return value;
}
};
enum eQ3ModifierFunction
{
TCMOD = 0,
DEFORMVERTEXES = 1,
RGBGEN = 2,
TCGEN = 3,
MAP = 4,
ALPHAGEN = 5,
FUNCTION2 = 0x10,
SCROLL = FUNCTION2 + 1,
SCALE = FUNCTION2 + 2,
ROTATE = FUNCTION2 + 3,
STRETCH = FUNCTION2 + 4,
TURBULENCE = FUNCTION2 + 5,
WAVE = FUNCTION2 + 6,
IDENTITY = FUNCTION2 + 7,
VERTEX = FUNCTION2 + 8,
TEXTURE = FUNCTION2 + 9,
LIGHTMAP = FUNCTION2 + 10,
ENVIRONMENT = FUNCTION2 + 11,
DOLLAR_LIGHTMAP = FUNCTION2 + 12,
BULGE = FUNCTION2 + 13,
AUTOSPRITE = FUNCTION2 + 14,
AUTOSPRITE2 = FUNCTION2 + 15,
TRANSFORM = FUNCTION2 + 16,
EXACTVERTEX = FUNCTION2 + 17,
CONSTANT = FUNCTION2 + 18,
LIGHTINGSPECULAR = FUNCTION2 + 19,
MOVE = FUNCTION2 + 20,
NORMAL = FUNCTION2 + 21,
IDENTITYLIGHTING = FUNCTION2 + 22,
WAVE_MODIFIER_FUNCTION = 0x30,
SINUS = WAVE_MODIFIER_FUNCTION + 1,
COSINUS = WAVE_MODIFIER_FUNCTION + 2,
SQUARE = WAVE_MODIFIER_FUNCTION + 3,
TRIANGLE = WAVE_MODIFIER_FUNCTION + 4,
SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5,
SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6,
NOISE = WAVE_MODIFIER_FUNCTION + 7,
UNKNOWN = -2
};
struct SModifierFunction
{
SModifierFunction ()
: masterfunc0 ( UNKNOWN ), masterfunc1( UNKNOWN ), func ( SINUS ),
tcgen( TEXTURE ), rgbgen ( IDENTITY ), alphagen ( UNKNOWN ),
base ( 0 ), amp ( 1 ), phase ( 0 ), frequency ( 1 ),
wave ( 1 ),
x ( 0 ), y ( 0 ), z( 0 ), count( 0 ) {}
// "tcmod","deformvertexes","rgbgen", "tcgen"
eQ3ModifierFunction masterfunc0;
// depends
eQ3ModifierFunction masterfunc1;
// depends
eQ3ModifierFunction func;
eQ3ModifierFunction tcgen;
eQ3ModifierFunction rgbgen;
eQ3ModifierFunction alphagen;
union
{
f32 base;
f32 bulgewidth;
};
union
{
f32 amp;
f32 bulgeheight;
};
f32 phase;
union
{
f32 frequency;
f32 bulgespeed;
};
union
{
f32 wave;
f32 div;
};
f32 x;
f32 y;
f32 z;
u32 count;
f32 evaluate ( f32 dt ) const
{
// phase in 0 and 1..
f32 x = core::fract( (dt + phase ) * frequency );
f32 y = 0.f;
switch ( func )
{
case SINUS:
y = sinf ( x * core::PI * 2.f );
break;
case COSINUS:
y = cosf ( x * core::PI * 2.f );
break;
case SQUARE:
y = x < 0.5f ? 1.f : -1.f;
break;
case TRIANGLE:
y = x < 0.5f ? ( 4.f * x ) - 1.f : ( -4.f * x ) + 3.f;
break;
case SAWTOOTH:
y = x;
break;
case SAWTOOTH_INVERSE:
y = 1.f - x;
break;
case NOISE:
y = Noiser::get();
break;
default:
break;
}
return base + ( y * amp );
}
};
inline core::vector3df getMD3Normal ( u32 i, u32 j )
{
const f32 lng = i * 2.0f * core::PI / 255.0f;
const f32 lat = j * 2.0f * core::PI / 255.0f;
return core::vector3df(cosf ( lat ) * sinf ( lng ),
sinf ( lat ) * sinf ( lng ),
cosf ( lng ));
}
//
inline void getModifierFunc ( SModifierFunction& fill, const core::stringc &string, u32 &pos )
{
if ( string.size() == 0 )
return;
static const c8 * funclist[] =
{
"sin","cos","square",
"triangle", "sawtooth","inversesawtooth", "noise"
};
fill.func = (eQ3ModifierFunction) isEqual ( string,pos, funclist,7 );
fill.func = fill.func == UNKNOWN ? SINUS : (eQ3ModifierFunction) ((u32) fill.func + WAVE_MODIFIER_FUNCTION + 1);
fill.base = getAsFloat ( string, pos );
fill.amp = getAsFloat ( string, pos );
fill.phase = getAsFloat ( string, pos );
fill.frequency = getAsFloat ( string, pos );
}
// name = "a b c .."
struct SVariable
{
core::stringc name;
core::stringc content;
SVariable ( const c8 * n, const c8 *c = 0 ) : name ( n ), content (c) {}
virtual ~SVariable () {}
void clear ()
{
name = "";
content = "";
}
s32 isValid () const
{
return name.size();
}
bool operator == ( const SVariable &other ) const
{
return 0 == strcmp ( name.c_str(), other.name.c_str () );
}
bool operator < ( const SVariable &other ) const
{
return 0 > strcmp ( name.c_str(), other.name.c_str () );
}
};
// string database. "a" = "Hello", "b" = "1234.6"
struct SVarGroup
{
SVarGroup () { Variable.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); }
virtual ~SVarGroup () {}
u32 isDefined ( const c8 * name, const c8 * content = 0 ) const
{
for ( u32 i = 0; i != Variable.size (); ++i )
{
if ( 0 == strcmp ( Variable[i].name.c_str(), name ) &&
( 0 == content || strstr ( Variable[i].content.c_str(), content ) )
)
{
return i + 1;
}
}
return 0;
}
// searches for Variable name and returns is content
// if Variable is not found a reference to an Empty String is returned
const core::stringc &get( const c8 * name ) const
{
SVariable search ( name );
s32 index = Variable.linear_search ( search );
if ( index < 0 )
return irrEmptyStringc;
return Variable [ index ].content;
}
// set the Variable name
void set ( const c8 * name, const c8 * content = 0 )
{
u32 index = isDefined ( name, 0 );
if ( 0 == index )
{
Variable.push_back ( SVariable ( name, content ) );
}
else
{
Variable [ index ].content = content;
}
}
core::array < SVariable > Variable;
};
struct SVarGroupList: public IReferenceCounted
{
SVarGroupList ()
{
VariableGroup.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE );
}
virtual ~SVarGroupList () {}
core::array < SVarGroup > VariableGroup;
};
struct IShader
{
IShader ()
: ID ( 0 ), VarGroup ( 0 ) {}
virtual ~IShader () {}
void operator = (const IShader &other )
{
ID = other.ID;
VarGroup = other.VarGroup;
name = other.name;
}
bool operator == (const IShader &other ) const
{
return 0 == strcmp ( name.c_str(), other.name.c_str () );
//return name == other.name;
}
bool operator < (const IShader &other ) const
{
return strcmp ( name.c_str(), other.name.c_str () ) < 0;
//return name < other.name;
}
u32 getGroupSize () const
{
if ( 0 == VarGroup )
return 0;
return VarGroup->VariableGroup.size ();
}
const SVarGroup * getGroup ( u32 stage ) const
{
if ( 0 == VarGroup || stage >= VarGroup->VariableGroup.size () )
return 0;
return &VarGroup->VariableGroup [ stage ];
}
// id
s32 ID;
SVarGroupList *VarGroup; // reference
// Shader: shader name ( also first variable in first Vargroup )
// Entity: classname ( variable in Group(1) )
core::stringc name;
};
typedef IShader IEntity;
typedef core::array < IEntity > tQ3EntityList;
/*
dump shader like original layout, regardless of internal data holding
no recursive folding..
*/
inline void dumpVarGroup ( core::stringc &dest, const SVarGroup * group, s32 stack )
{
core::stringc buf;
s32 i;
if ( stack > 0 )
{
buf = "";
for ( i = 0; i < stack - 1; ++i )
buf += '\t';
buf += "{\n";
dest.append ( buf );
}
for ( u32 g = 0; g != group->Variable.size(); ++g )
{
buf = "";
for ( i = 0; i < stack; ++i )
buf += '\t';
buf += group->Variable[g].name;
buf += " ";
buf += group->Variable[g].content;
buf += "\n";
dest.append ( buf );
}
if ( stack > 1 )
{
buf = "";
for ( i = 0; i < stack - 1; ++i )
buf += '\t';
buf += "}\n";
dest.append ( buf );
}
}
inline core::stringc & dumpShader ( core::stringc &dest, const IShader * shader, bool entity = false )
{
if ( 0 == shader )
return dest;
const SVarGroup * group;
const u32 size = shader->VarGroup->VariableGroup.size ();
for ( u32 i = 0; i != size; ++i )
{
group = &shader->VarGroup->VariableGroup[ i ];
dumpVarGroup ( dest, group, core::clamp( (int)i, 0, 2 ) );
}
if ( !entity )
{
if ( size <= 1 )
{
dest.append ( "{\n" );
}
dest.append ( "}\n" );
}
return dest;
}
/*
quake3 doesn't care much about tga & jpg
load one or multiple files stored in name started at startPos to the texture array textures
if texture is not loaded 0 will be added ( to find missing textures easier)
*/
inline void getTextures(tTexArray &textures,
const core::stringc &name, u32 &startPos,
io::IFileSystem *fileSystem,
video::IVideoDriver* driver)
{
static const char* extension[] =
{
".jpg",
".jpeg",
".png",
".dds",
".tga",
".bmp",
".pcx"
};
tStringList stringList;
getAsStringList(stringList, -1, name, startPos);
textures.clear();
io::path loadFile;
for ( u32 i = 0; i!= stringList.size (); ++i )
{
video::ITexture* texture = 0;
for (u32 g = 0; g != 7 ; ++g)
{
core::cutFilenameExtension ( loadFile, stringList[i] );
if ( loadFile == "$whiteimage" )
{
texture = driver->getTexture( "$whiteimage" );
if ( 0 == texture )
{
core::dimension2du s ( 2, 2 );
u32 image[4] = { 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF };
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
texture = driver->addTexture( "$whiteimage", w );
w->drop ();
}
}
else
if ( loadFile == "$redimage" )
{
texture = driver->getTexture( "$redimage" );
if ( 0 == texture )
{
core::dimension2du s ( 2, 2 );
u32 image[4] = { 0xFFFF0000, 0xFFFF0000,0xFFFF0000,0xFFFF0000 };
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
texture = driver->addTexture( "$redimage", w );
w->drop ();
}
}
else
if ( loadFile == "$blueimage" )
{
texture = driver->getTexture( "$blueimage" );
if ( 0 == texture )
{
core::dimension2du s ( 2, 2 );
u32 image[4] = { 0xFF0000FF, 0xFF0000FF,0xFF0000FF,0xFF0000FF };
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
texture = driver->addTexture( "$blueimage", w );
w->drop ();
}
}
else
if ( loadFile == "$checkerimage" )
{
texture = driver->getTexture( "$checkerimage" );
if ( 0 == texture )
{
core::dimension2du s ( 2, 2 );
u32 image[4] = { 0xFFFFFFFF, 0xFF000000,0xFF000000,0xFFFFFFFF };
video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
texture = driver->addTexture( "$checkerimage", w );
w->drop ();
}
}
else
if ( loadFile == "$lightmap" )
{
texture = 0;
}
else
{
loadFile.append ( extension[g] );
}
if ( fileSystem->existFile ( loadFile ) )
{
texture = driver->getTexture( loadFile );
if ( texture )
break;
texture = 0;
}
}
// take 0 Texture
textures.push_back(texture);
}
}
class IShaderManager : public IReferenceCounted
{
};
} // end namespace quake3
} // end namespace scene
} // end namespace irr
#endif
IFileSystem.h
IVideoDriver.h
__BIG_ENDIAN__
#define __BIG_ENDIAN__
Definition IrrCompileConfig.h:105
irr::IReferenceCounted::drop
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.h:116
irr::IReferenceCounted::IReferenceCounted
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:46
irr::core::array< core::stringc >
irr::core::array::clear
void clear()
Clears the array and deletes all allocated memory.
Definition irrArray.h:203
irr::core::array::size
u32 size() const
Get number of occupied elements of the array.
Definition irrArray.h:368
irr::core::array::push_back
void push_back(const T &element)
Adds an element at back of array.
Definition irrArray.h:112
irr::core::string::size
u32 size() const
Returns length of the string's content.
Definition irrString.h:481
irr::core::string::append
string< T, TAlloc > & append(T character)
Appends a character to this string.
Definition irrString.h:603
irr::core::string::c_str
const T * c_str() const
Returns character string.
Definition irrString.h:495
irr::core::vector3d::X
T X
X coordinate of the vector.
Definition vector3d.h:408
irr::core::vector3d::Z
T Z
Z coordinate of the vector.
Definition vector3d.h:414
irr::core::vector3d::Y
T Y
Y coordinate of the vector.
Definition vector3d.h:411
irr::io::IFileSystem
The FileSystem manages files and archives and provides access to them.
Definition IFileSystem.h:33
irr::io::IFileSystem::existFile
virtual bool existFile(const path &filename) const =0
Determines if a file exists and could be opened.
irr::scene::quake3::IShaderManager
Manages various Quake3 Shader Styles.
Definition IQ3Shader.h:877
irr::video::IImage
Interface for software image data.
Definition IImage.h:23
irr::video::ITexture
Interface of a Video Driver dependent Texture.
Definition ITexture.h:99
irr::video::IVideoDriver
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.h:257
irr::video::IVideoDriver::getTexture
virtual ITexture * getTexture(const io::path &filename)=0
Get access to a named texture.
irr::video::IVideoDriver::createImageFromData
virtual IImage * createImageFromData(ECOLOR_FORMAT format, const core::dimension2d< u32 > &size, void *data, bool ownForeignMemory=false, bool deleteMemory=true)=0
Creates a software image from a byte array.
irr::video::IVideoDriver::addTexture
virtual ITexture * addTexture(const core::dimension2d< u32 > &size, const io::path &name, ECOLOR_FORMAT format=ECF_A8R8G8B8)=0
Creates an empty texture of specified size.
coreutil.h
File containing useful basic utility functions.
fast_atof.h
irrArray.h
irr::core::vector3df
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445
irr::core::fast_atof_move
const char * fast_atof_move(const char *in, f32 &result)
Provides a fast function for converting a string into a float.
Definition fast_atof.h:310
irr::core::PI
const f32 PI
Constant for PI.
Definition irrMath.h:56
irr::core::clamp
const T clamp(const T &value, const T &low, const T &high)
clamps a value between low and high
Definition irrMath.h:166
irr::core::ALLOC_STRATEGY_SAFE
@ ALLOC_STRATEGY_SAFE
Definition irrAllocator.h:114
irr::core::dimension2du
dimension2d< u32 > dimension2du
Typedef for an unsigned integer dimension.
Definition dimension2d.h:212
irr::core::stringc
string< c8 > stringc
Typedef for character strings.
Definition irrString.h:1358
irr::core::fract
f32 fract(f32 x)
Definition irrMath.h:718
irr::core::cutFilenameExtension
io::path & cutFilenameExtension(io::path &dest, const io::path &source)
cut the filename extension from a source file path and store it in a dest file path
Definition coreutil.h:49
irr::io::path
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.h:17
irr::scene::quake3
Definition IQ3Shader.h:19
irr::scene::quake3::getDepthFunction
u8 getDepthFunction(const core::stringc &string)
Definition IQ3Shader.h:193
irr::scene::quake3::getMD3Normal
core::vector3df getMD3Normal(u32 i, u32 j)
Definition IQ3Shader.h:510
irr::scene::quake3::tQ3EntityList
core::array< IEntity > tQ3EntityList
Definition IQ3Shader.h:689
irr::scene::quake3::dumpShader
core::stringc & dumpShader(core::stringc &dest, const IShader *shader, bool entity=false)
Definition IQ3Shader.h:739
irr::scene::quake3::isEqual
s16 isEqual(const core::stringc &string, u32 &pos, const c8 *list[], u16 listSize)
Definition IQ3Shader.h:83
irr::scene::quake3::eQ3MeshIndex
eQ3MeshIndex
Hold the different Mesh Types used for getMesh.
Definition IQ3Shader.h:25
irr::scene::quake3::E_Q3_MESH_GEOMETRY
@ E_Q3_MESH_GEOMETRY
Definition IQ3Shader.h:26
irr::scene::quake3::E_Q3_MESH_ITEMS
@ E_Q3_MESH_ITEMS
Definition IQ3Shader.h:27
irr::scene::quake3::E_Q3_MESH_FOG
@ E_Q3_MESH_FOG
Definition IQ3Shader.h:29
irr::scene::quake3::E_Q3_MESH_UNRESOLVED
@ E_Q3_MESH_UNRESOLVED
Definition IQ3Shader.h:30
irr::scene::quake3::E_Q3_MESH_BILLBOARD
@ E_Q3_MESH_BILLBOARD
Definition IQ3Shader.h:28
irr::scene::quake3::E_Q3_MESH_SIZE
@ E_Q3_MESH_SIZE
Definition IQ3Shader.h:31
irr::scene::quake3::eQ3ModifierFunction
eQ3ModifierFunction
Definition IQ3Shader.h:373
irr::scene::quake3::TRANSFORM
@ TRANSFORM
Definition IQ3Shader.h:398
irr::scene::quake3::MOVE
@ MOVE
Definition IQ3Shader.h:402
irr::scene::quake3::CONSTANT
@ CONSTANT
Definition IQ3Shader.h:400
irr::scene::quake3::TEXTURE
@ TEXTURE
Definition IQ3Shader.h:391
irr::scene::quake3::SCALE
@ SCALE
Definition IQ3Shader.h:383
irr::scene::quake3::UNKNOWN
@ UNKNOWN
Definition IQ3Shader.h:416
irr::scene::quake3::LIGHTMAP
@ LIGHTMAP
Definition IQ3Shader.h:392
irr::scene::quake3::VERTEX
@ VERTEX
Definition IQ3Shader.h:390
irr::scene::quake3::TCMOD
@ TCMOD
Definition IQ3Shader.h:374
irr::scene::quake3::SAWTOOTH_INVERSE
@ SAWTOOTH_INVERSE
Definition IQ3Shader.h:412
irr::scene::quake3::LIGHTINGSPECULAR
@ LIGHTINGSPECULAR
Definition IQ3Shader.h:401
irr::scene::quake3::DOLLAR_LIGHTMAP
@ DOLLAR_LIGHTMAP
Definition IQ3Shader.h:394
irr::scene::quake3::ALPHAGEN
@ ALPHAGEN
Definition IQ3Shader.h:379
irr::scene::quake3::NORMAL
@ NORMAL
Definition IQ3Shader.h:403
irr::scene::quake3::AUTOSPRITE2
@ AUTOSPRITE2
Definition IQ3Shader.h:397
irr::scene::quake3::ENVIRONMENT
@ ENVIRONMENT
Definition IQ3Shader.h:393
irr::scene::quake3::RGBGEN
@ RGBGEN
Definition IQ3Shader.h:376
irr::scene::quake3::SCROLL
@ SCROLL
Definition IQ3Shader.h:382
irr::scene::quake3::IDENTITYLIGHTING
@ IDENTITYLIGHTING
Definition IQ3Shader.h:404
irr::scene::quake3::DEFORMVERTEXES
@ DEFORMVERTEXES
Definition IQ3Shader.h:375
irr::scene::quake3::MAP
@ MAP
Definition IQ3Shader.h:378
irr::scene::quake3::FUNCTION2
@ FUNCTION2
Definition IQ3Shader.h:381
irr::scene::quake3::WAVE_MODIFIER_FUNCTION
@ WAVE_MODIFIER_FUNCTION
Definition IQ3Shader.h:406
irr::scene::quake3::COSINUS
@ COSINUS
Definition IQ3Shader.h:408
irr::scene::quake3::TCGEN
@ TCGEN
Definition IQ3Shader.h:377
irr::scene::quake3::ROTATE
@ ROTATE
Definition IQ3Shader.h:384
irr::scene::quake3::NOISE
@ NOISE
Definition IQ3Shader.h:413
irr::scene::quake3::SQUARE
@ SQUARE
Definition IQ3Shader.h:409
irr::scene::quake3::IDENTITY
@ IDENTITY
Definition IQ3Shader.h:389
irr::scene::quake3::STRETCH
@ STRETCH
Definition IQ3Shader.h:385
irr::scene::quake3::TRIANGLE
@ TRIANGLE
Definition IQ3Shader.h:410
irr::scene::quake3::TURBULENCE
@ TURBULENCE
Definition IQ3Shader.h:386
irr::scene::quake3::SINUS
@ SINUS
Definition IQ3Shader.h:407
irr::scene::quake3::BULGE
@ BULGE
Definition IQ3Shader.h:395
irr::scene::quake3::SAWTOOTH
@ SAWTOOTH
Definition IQ3Shader.h:411
irr::scene::quake3::WAVE
@ WAVE
Definition IQ3Shader.h:387
irr::scene::quake3::AUTOSPRITE
@ AUTOSPRITE
Definition IQ3Shader.h:396
irr::scene::quake3::EXACTVERTEX
@ EXACTVERTEX
Definition IQ3Shader.h:399
irr::scene::quake3::getCullingFunction
bool getCullingFunction(const core::stringc &cull)
Definition IQ3Shader.h:171
irr::scene::quake3::getAsVector3df
core::vector3df getAsVector3df(const core::stringc &string, u32 &pos)
get a quake3 vector translated to irrlicht position (x,-z,y )
Definition IQ3Shader.h:115
irr::scene::quake3::getTextures
void getTextures(tTexArray &textures, const core::stringc &name, u32 &startPos, io::IFileSystem *fileSystem, video::IVideoDriver *driver)
Definition IQ3Shader.h:770
irr::scene::quake3::IEntity
IShader IEntity
Definition IQ3Shader.h:687
irr::scene::quake3::getAsStringList
void getAsStringList(tStringList &list, s32 max, const core::stringc &string, u32 &startPos)
Definition IQ3Shader.h:130
irr::scene::quake3::dumpVarGroup
void dumpVarGroup(core::stringc &dest, const SVarGroup *group, s32 stack)
Definition IQ3Shader.h:695
irr::scene::quake3::tTexArray
core::array< video::ITexture * > tTexArray
Definition IQ3Shader.h:80
irr::scene::quake3::getModifierFunc
void getModifierFunc(SModifierFunction &fill, const core::stringc &string, u32 &pos)
Definition IQ3Shader.h:520
irr::scene::quake3::getAsFloat
f32 getAsFloat(const core::stringc &string, u32 &pos)
Definition IQ3Shader.h:105
irr::scene::quake3::tStringList
core::array< core::stringc > tStringList
Definition IQ3Shader.h:79
irr::scene
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CDynamicMeshBuffer.h:16
irr::video
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
irr::video::E_MODULATE_FUNC
E_MODULATE_FUNC
MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X.
Definition SMaterial.h:55
irr::video::ECF_A8R8G8B8
@ ECF_A8R8G8B8
Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
Definition SColor.h:32
irr::video::E_MATERIAL_FLAG
E_MATERIAL_FLAG
Material flags.
Definition EMaterialFlags.h:15
irr::video::E_MATERIAL_TYPE
E_MATERIAL_TYPE
Abstracted and easy to use fixed function/programmable pipeline material modes.
Definition EMaterialTypes.h:15
irr::video::EMT_ONETEXTURE_BLEND
@ EMT_ONETEXTURE_BLEND
BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC ).
Definition EMaterialTypes.h:193
irr::video::EMT_TRANSPARENT_ADD_COLOR
@ EMT_TRANSPARENT_ADD_COLOR
A transparent material.
Definition EMaterialTypes.h:88
irr::video::EMT_SOLID
@ EMT_SOLID
Standard solid material.
Definition EMaterialTypes.h:19
irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL
@ EMT_TRANSPARENT_ALPHA_CHANNEL
Makes the material transparent based on the texture alpha channel.
Definition EMaterialTypes.h:101
irr::video::E_BLEND_FACTOR
E_BLEND_FACTOR
Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor.
Definition SMaterial.h:24
irr::video::EBF_SRC_ALPHA
@ EBF_SRC_ALPHA
src & dest (srcA, srcA, srcA, srcA)
Definition SMaterial.h:31
irr::video::EBF_ONE
@ EBF_ONE
src & dest (1, 1, 1, 1)
Definition SMaterial.h:26
irr::video::EBF_SRC_COLOR
@ EBF_SRC_COLOR
dest (srcR, srcG, srcB, srcA)
Definition SMaterial.h:29
irr::video::EBF_ZERO
@ EBF_ZERO
src & dest (0, 0, 0, 0)
Definition SMaterial.h:25
irr::video::EBF_ONE_MINUS_SRC_ALPHA
@ EBF_ONE_MINUS_SRC_ALPHA
src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
Definition SMaterial.h:32
irr::video::EBF_DST_COLOR
@ EBF_DST_COLOR
src (destR, destG, destB, destA)
Definition SMaterial.h:27
irr::video::pack_textureBlendFunc
f32 pack_textureBlendFunc(const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE)
EMT_ONETEXTURE_BLEND: pack srcFact, dstFact, Modulate and alpha source to MaterialTypeParam.
Definition SMaterial.h:116
irr::video::ECFN_LESSEQUAL
@ ECFN_LESSEQUAL
<= test, default for e.g. depth test
Definition SMaterial.h:67
irr::video::ECFN_EQUAL
@ ECFN_EQUAL
Exact equality.
Definition SMaterial.h:69
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::f32
float f32
32 bit floating point variable.
Definition irrTypes.h:104
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::s16
signed short s16
16 bit signed variable.
Definition irrTypes.h:48
irr::u8
unsigned char u8
8 bit unsigned variable.
Definition irrTypes.h:18
irr::c8
char c8
8 bit character variable.
Definition irrTypes.h:31
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
irr::u16
unsigned short u16
16 bit unsigned variable.
Definition irrTypes.h:40
irr::scene::quake3::IShader
A Parsed Shader Holding Variables ordered in Groups.
Definition IQ3Shader.h:639
irr::scene::quake3::IShader::operator==
bool operator==(const IShader &other) const
Definition IQ3Shader.h:651
irr::scene::quake3::IShader::operator<
bool operator<(const IShader &other) const
Definition IQ3Shader.h:657
irr::scene::quake3::IShader::name
core::stringc name
Definition IQ3Shader.h:684
irr::scene::quake3::IShader::ID
s32 ID
Definition IQ3Shader.h:679
irr::scene::quake3::IShader::getGroup
const SVarGroup * getGroup(u32 stage) const
Definition IQ3Shader.h:670
irr::scene::quake3::IShader::VarGroup
SVarGroupList * VarGroup
Definition IQ3Shader.h:680
irr::scene::quake3::IShader::getGroupSize
u32 getGroupSize() const
Definition IQ3Shader.h:663
irr::scene::quake3::IShader::~IShader
virtual ~IShader()
Definition IQ3Shader.h:642
irr::scene::quake3::IShader::IShader
IShader()
Definition IQ3Shader.h:640
irr::scene::quake3::IShader::operator=
void operator=(const IShader &other)
Definition IQ3Shader.h:644
irr::scene::quake3::Noiser
Definition IQ3Shader.h:361
irr::scene::quake3::Noiser::get
static f32 get()
Definition IQ3Shader.h:362
irr::scene::quake3::Q3LevelLoadParameter::defaultModulate
video::E_MODULATE_FUNC defaultModulate
Definition IQ3Shader.h:62
irr::scene::quake3::Q3LevelLoadParameter::swapHeader
s32 swapHeader
Definition IQ3Shader.h:74
irr::scene::quake3::Q3LevelLoadParameter::cleanUnResolvedMeshes
s32 cleanUnResolvedMeshes
Definition IQ3Shader.h:69
irr::scene::quake3::Q3LevelLoadParameter::scriptDir
c8 scriptDir[64]
Definition IQ3Shader.h:75
irr::scene::quake3::Q3LevelLoadParameter::verbose
s32 verbose
Definition IQ3Shader.h:65
irr::scene::quake3::Q3LevelLoadParameter::mergeShaderBuffer
s32 mergeShaderBuffer
Definition IQ3Shader.h:68
irr::scene::quake3::Q3LevelLoadParameter::Q3LevelLoadParameter
Q3LevelLoadParameter()
Definition IQ3Shader.h:39
irr::scene::quake3::Q3LevelLoadParameter::loadAllShaders
s32 loadAllShaders
Definition IQ3Shader.h:70
irr::scene::quake3::Q3LevelLoadParameter::startTime
u32 startTime
Definition IQ3Shader.h:66
irr::scene::quake3::Q3LevelLoadParameter::alpharef
s32 alpharef
Definition IQ3Shader.h:72
irr::scene::quake3::Q3LevelLoadParameter::endTime
u32 endTime
Definition IQ3Shader.h:67
irr::scene::quake3::Q3LevelLoadParameter::swapLump
s32 swapLump
Definition IQ3Shader.h:73
irr::scene::quake3::Q3LevelLoadParameter::loadSkyShader
s32 loadSkyShader
Definition IQ3Shader.h:71
irr::scene::quake3::Q3LevelLoadParameter::patchTesselation
s32 patchTesselation
Definition IQ3Shader.h:64
irr::scene::quake3::Q3LevelLoadParameter::defaultFilter
video::E_MATERIAL_FLAG defaultFilter
Definition IQ3Shader.h:63
irr::scene::quake3::Q3LevelLoadParameter::defaultLightMapMaterial
video::E_MATERIAL_TYPE defaultLightMapMaterial
Definition IQ3Shader.h:61
irr::scene::quake3::SBlendFunc::modulate
video::E_MODULATE_FUNC modulate
Definition IQ3Shader.h:164
irr::scene::quake3::SBlendFunc::isTransparent
u32 isTransparent
Definition IQ3Shader.h:167
irr::scene::quake3::SBlendFunc::type
video::E_MATERIAL_TYPE type
Definition IQ3Shader.h:163
irr::scene::quake3::SBlendFunc::param0
f32 param0
Definition IQ3Shader.h:166
irr::scene::quake3::SBlendFunc::SBlendFunc
SBlendFunc(video::E_MODULATE_FUNC mod)
Definition IQ3Shader.h:158
irr::scene::quake3::SModifierFunction
Definition IQ3Shader.h:421
irr::scene::quake3::SModifierFunction::SModifierFunction
SModifierFunction()
Definition IQ3Shader.h:422
irr::scene::quake3::SModifierFunction::x
f32 x
Definition IQ3Shader.h:466
irr::scene::quake3::SModifierFunction::masterfunc1
eQ3ModifierFunction masterfunc1
Definition IQ3Shader.h:432
irr::scene::quake3::SModifierFunction::div
f32 div
Definition IQ3Shader.h:463
irr::scene::quake3::SModifierFunction::bulgespeed
f32 bulgespeed
Definition IQ3Shader.h:457
irr::scene::quake3::SModifierFunction::bulgeheight
f32 bulgeheight
Definition IQ3Shader.h:449
irr::scene::quake3::SModifierFunction::masterfunc0
eQ3ModifierFunction masterfunc0
Definition IQ3Shader.h:430
irr::scene::quake3::SModifierFunction::y
f32 y
Definition IQ3Shader.h:467
irr::scene::quake3::SModifierFunction::base
f32 base
Definition IQ3Shader.h:442
irr::scene::quake3::SModifierFunction::wave
f32 wave
Definition IQ3Shader.h:462
irr::scene::quake3::SModifierFunction::bulgewidth
f32 bulgewidth
Definition IQ3Shader.h:443
irr::scene::quake3::SModifierFunction::phase
f32 phase
Definition IQ3Shader.h:452
irr::scene::quake3::SModifierFunction::count
u32 count
Definition IQ3Shader.h:469
irr::scene::quake3::SModifierFunction::frequency
f32 frequency
Definition IQ3Shader.h:456
irr::scene::quake3::SModifierFunction::tcgen
eQ3ModifierFunction tcgen
Definition IQ3Shader.h:436
irr::scene::quake3::SModifierFunction::alphagen
eQ3ModifierFunction alphagen
Definition IQ3Shader.h:438
irr::scene::quake3::SModifierFunction::func
eQ3ModifierFunction func
Definition IQ3Shader.h:434
irr::scene::quake3::SModifierFunction::z
f32 z
Definition IQ3Shader.h:468
irr::scene::quake3::SModifierFunction::evaluate
f32 evaluate(f32 dt) const
Definition IQ3Shader.h:471
irr::scene::quake3::SModifierFunction::amp
f32 amp
Definition IQ3Shader.h:448
irr::scene::quake3::SModifierFunction::rgbgen
eQ3ModifierFunction rgbgen
Definition IQ3Shader.h:437
irr::scene::quake3::SVarGroup
Definition IQ3Shader.h:576
irr::scene::quake3::SVarGroup::isDefined
u32 isDefined(const c8 *name, const c8 *content=0) const
Definition IQ3Shader.h:580
irr::scene::quake3::SVarGroup::get
const core::stringc & get(const c8 *name) const
Definition IQ3Shader.h:596
irr::scene::quake3::SVarGroup::~SVarGroup
virtual ~SVarGroup()
Definition IQ3Shader.h:578
irr::scene::quake3::SVarGroup::SVarGroup
SVarGroup()
Definition IQ3Shader.h:577
irr::scene::quake3::SVarGroup::set
void set(const c8 *name, const c8 *content=0)
Definition IQ3Shader.h:607
irr::scene::quake3::SVarGroup::Variable
core::array< SVariable > Variable
Definition IQ3Shader.h:621
irr::scene::quake3::SVarGroupList
holding a group a variable
Definition IQ3Shader.h:626
irr::scene::quake3::SVarGroupList::SVarGroupList
SVarGroupList()
Definition IQ3Shader.h:627
irr::scene::quake3::SVarGroupList::VariableGroup
core::array< SVarGroup > VariableGroup
Definition IQ3Shader.h:633
irr::scene::quake3::SVarGroupList::~SVarGroupList
virtual ~SVarGroupList()
Definition IQ3Shader.h:631
irr::scene::quake3::SVariable
Definition IQ3Shader.h:543
irr::scene::quake3::SVariable::SVariable
SVariable(const c8 *n, const c8 *c=0)
Definition IQ3Shader.h:547
irr::scene::quake3::SVariable::clear
void clear()
Definition IQ3Shader.h:550
irr::scene::quake3::SVariable::~SVariable
virtual ~SVariable()
Definition IQ3Shader.h:548
irr::scene::quake3::SVariable::content
core::stringc content
Definition IQ3Shader.h:545
irr::scene::quake3::SVariable::isValid
s32 isValid() const
Definition IQ3Shader.h:556
irr::scene::quake3::SVariable::operator==
bool operator==(const SVariable &other) const
Definition IQ3Shader.h:561
irr::scene::quake3::SVariable::operator<
bool operator<(const SVariable &other) const
Definition IQ3Shader.h:566
irr::scene::quake3::SVariable::name
core::stringc name
Definition IQ3Shader.h:544
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0