forked from speed-dreams/speed-dreams-code
- Update OsgCar for shaders
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6889 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: f293d68004f66ea1754250be943408b40123d165 Former-commit-id: 64fabb71b5d5ac68df20f830dc01c3a8f01680ba
This commit is contained in:
parent
bff70a4158
commit
da08ee36b4
5 changed files with 8 additions and 3 deletions
|
@ -98,6 +98,7 @@
|
||||||
#define GR_ATT_AGR_MEDIUM "medium"
|
#define GR_ATT_AGR_MEDIUM "medium"
|
||||||
#define GR_ATT_AGR_FULL "full"
|
#define GR_ATT_AGR_FULL "full"
|
||||||
#define GR_ATT_AGR_HIGH "high"
|
#define GR_ATT_AGR_HIGH "high"
|
||||||
|
#define GR_ATT_AGR_ULTRA "ultra"
|
||||||
#define GR_ATT_ENV_SIZE "environment size"
|
#define GR_ATT_ENV_SIZE "environment size"
|
||||||
|
|
||||||
#define GR_ATT_NB_SCREENS "number of screens"
|
#define GR_ATT_NB_SCREENS "number of screens"
|
||||||
|
|
|
@ -108,6 +108,7 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
||||||
int nranges = 0;
|
int nranges = 0;
|
||||||
|
|
||||||
_carShader = carshader;
|
_carShader = carshader;
|
||||||
|
GfLogInfo("Graphic options car shader = %u\n", _carShader);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
osgLoader loader;
|
osgLoader loader;
|
||||||
|
@ -869,11 +870,12 @@ void SDCar::updateCar()
|
||||||
else
|
else
|
||||||
pLightBrake->setSingleChildOn(1);
|
pLightBrake->setSingleChildOn(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
wheels.updateWheels();
|
wheels.updateWheels();
|
||||||
|
|
||||||
this->car_branch->setMatrix(mat);
|
this->car_branch->setMatrix(mat);
|
||||||
|
|
||||||
if(_carShader == 2)
|
if(_carShader > 2)
|
||||||
reflectionMapping->update();
|
reflectionMapping->update();
|
||||||
|
|
||||||
this->setReflectionMap(reflectionMapping->getReflectionMap());
|
this->setReflectionMap(reflectionMapping->getReflectionMap());
|
||||||
|
|
|
@ -102,6 +102,7 @@ SDReflectionMapping::SDReflectionMapping(SDCar *c):
|
||||||
{
|
{
|
||||||
SDScreens * screens = (SDScreens*)getScreens();
|
SDScreens * screens = (SDScreens*)getScreens();
|
||||||
screens->registerViewDependantPreRenderNode(this->getCamerasRoot());
|
screens->registerViewDependantPreRenderNode(this->getCamerasRoot());
|
||||||
|
GfLogInfo("Graphic options : reflectionShader = %u\n", reflectionShader);
|
||||||
|
|
||||||
cameras[4]->setNodeMask(NODE_MASK_ALL);
|
cameras[4]->setNodeMask(NODE_MASK_ALL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ static const char* TexSizeValues[] = { GR_ATT_SHADOW_512, GR_ATT_SHADOW_1024, GR
|
||||||
static const int NbTexSizeValues = sizeof(TexSizeValues) / sizeof(TexSizeValues[0]);
|
static const int NbTexSizeValues = sizeof(TexSizeValues) / sizeof(TexSizeValues[0]);
|
||||||
static const char* QualityValues[] = { GR_ATT_AGR_LITTLE, GR_ATT_AGR_MEDIUM, GR_ATT_AGR_FULL };
|
static const char* QualityValues[] = { GR_ATT_AGR_LITTLE, GR_ATT_AGR_MEDIUM, GR_ATT_AGR_FULL };
|
||||||
static const int NbQualityValues = sizeof(QualityValues) / sizeof(QualityValues[0]);
|
static const int NbQualityValues = sizeof(QualityValues) / sizeof(QualityValues[0]);
|
||||||
static const char* ShadersValues[] = { GR_ATT_AGR_NULL, GR_ATT_AGR_LITTLE, GR_ATT_AGR_FULL };
|
static const char* ShadersValues[] = { GR_ATT_AGR_NULL, GR_ATT_AGR_LITTLE, GR_ATT_AGR_MEDIUM, GR_ATT_AGR_FULL, GR_ATT_AGR_HIGH, GR_ATT_AGR_ULTRA };
|
||||||
static const int NbShadersValues = sizeof(ShadersValues) / sizeof(ShadersValues[0]);
|
static const int NbShadersValues = sizeof(ShadersValues) / sizeof(ShadersValues[0]);
|
||||||
static const int CloudsTextureIndices[TR_CLOUDS_FULL+1] = {1, 3, 5, 7, 8};
|
static const int CloudsTextureIndices[TR_CLOUDS_FULL+1] = {1, 3, 5, 7, 8};
|
||||||
static const int NCloudsTextureIndices = sizeof(CloudsTextureIndices) / sizeof(int);
|
static const int NCloudsTextureIndices = sizeof(CloudsTextureIndices) / sizeof(int);
|
||||||
|
@ -258,6 +258,7 @@ void SDRender::Init(tTrack *track)
|
||||||
GfLogInfo("Graphic options : Shadow Type : %u\n", ShadowIndex);
|
GfLogInfo("Graphic options : Shadow Type : %u\n", ShadowIndex);
|
||||||
GfLogInfo("Graphic options : Shadow Texture Size : %u\n", ShadowTexSize);
|
GfLogInfo("Graphic options : Shadow Texture Size : %u\n", ShadowTexSize);
|
||||||
GfLogInfo("Graphic options : Shadow Quality : %u\n", QualityIndex);
|
GfLogInfo("Graphic options : Shadow Quality : %u\n", QualityIndex);
|
||||||
|
GfLogInfo("Graphic options : Shader Quality : %u\n", carsShader);
|
||||||
|
|
||||||
NStars = NMaxStars;
|
NStars = NMaxStars;
|
||||||
if (AStarsData)
|
if (AStarsData)
|
||||||
|
|
|
@ -43,7 +43,7 @@ static const char* TexSizeValues[] = { GR_ATT_SHADOW_512, GR_ATT_SHADOW_1024, GR
|
||||||
static const int NbTexSizeValues = sizeof(TexSizeValues) / sizeof(TexSizeValues[0]);
|
static const int NbTexSizeValues = sizeof(TexSizeValues) / sizeof(TexSizeValues[0]);
|
||||||
static const char* QualityValues[] = { GR_ATT_AGR_LITTLE, GR_ATT_AGR_MEDIUM, GR_ATT_AGR_FULL };
|
static const char* QualityValues[] = { GR_ATT_AGR_LITTLE, GR_ATT_AGR_MEDIUM, GR_ATT_AGR_FULL };
|
||||||
static const int NbQualityValues = sizeof(QualityValues) / sizeof(QualityValues[0]);
|
static const int NbQualityValues = sizeof(QualityValues) / sizeof(QualityValues[0]);
|
||||||
static const char* ShadersValues[] = { GR_ATT_AGR_NULL, GR_ATT_AGR_LITTLE, GR_ATT_AGR_FULL };
|
static const char* ShadersValues[] = { GR_ATT_AGR_NULL, GR_ATT_AGR_LITTLE, GR_ATT_AGR_MEDIUM, GR_ATT_AGR_FULL, GR_ATT_AGR_HIGH, GR_ATT_AGR_ULTRA };
|
||||||
static const int NbShadersValues = sizeof(ShadersValues) / sizeof(ShadersValues[0]);
|
static const int NbShadersValues = sizeof(ShadersValues) / sizeof(ShadersValues[0]);
|
||||||
static const char* SpansplitValues[] = { GR_VAL_NO, GR_VAL_YES };
|
static const char* SpansplitValues[] = { GR_VAL_NO, GR_VAL_YES };
|
||||||
static const int NbSpansplitValues = sizeof(SpansplitValues) / sizeof(SpansplitValues[0]);
|
static const int NbSpansplitValues = sizeof(SpansplitValues) / sizeof(SpansplitValues[0]);
|
||||||
|
|
Loading…
Reference in a new issue