Add test for ps.1.1 pixel program in snowballs (it works too now)
--HG-- branch : multipass-stereo
This commit is contained in:
parent
c3af389ea6
commit
9f1ddc9202
2 changed files with 18 additions and 3 deletions
|
@ -171,7 +171,12 @@ public:
|
||||||
* - Alpha of texture in stage 0 is blended with alpha of texture in stage 1. Blend done with the alpha color of each
|
* - Alpha of texture in stage 0 is blended with alpha of texture in stage 1. Blend done with the alpha color of each
|
||||||
* stage and the whole is multiplied by the alpha in color vertex [AT0*ADiffuseCol+AT1*(1-ADiffuseCol)]*AStage
|
* stage and the whole is multiplied by the alpha in color vertex [AT0*ADiffuseCol+AT1*(1-ADiffuseCol)]*AStage
|
||||||
* - RGB still unchanged
|
* - RGB still unchanged
|
||||||
*
|
* Water :
|
||||||
|
* - Water
|
||||||
|
* PostProcessing :
|
||||||
|
* - For internal use only when a pixel program is set manually through activePixelProgram.
|
||||||
|
* - Only textures are set by CMaterial (probably does not work yet), the rest must be set manually.
|
||||||
|
* - May be replaced in the future by some generic shader system.
|
||||||
*/
|
*/
|
||||||
enum TShader { Normal=0,
|
enum TShader { Normal=0,
|
||||||
Bump,
|
Bump,
|
||||||
|
@ -183,6 +188,7 @@ public:
|
||||||
PerPixelLightingNoSpec,
|
PerPixelLightingNoSpec,
|
||||||
Cloud,
|
Cloud,
|
||||||
Water,
|
Water,
|
||||||
|
PostProcessing,
|
||||||
shaderCount};
|
shaderCount};
|
||||||
|
|
||||||
/// \name Texture Env Modes.
|
/// \name Texture Env Modes.
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include <nel/3d/driver_user.h>
|
#include <nel/3d/driver_user.h>
|
||||||
#include <nel/3d/driver.h>
|
#include <nel/3d/driver.h>
|
||||||
#include <nel/3d/pixel_program.h>
|
#include <nel/3d/pixel_program.h>
|
||||||
|
#include <nel/3d/material.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -292,12 +293,17 @@ void initCommands()
|
||||||
CommandsMaterial.setBlend(true);
|
CommandsMaterial.setBlend(true);
|
||||||
|
|
||||||
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
||||||
static const char *program =
|
CommandsMaterial.getObjectPtr()->setShader(NL3D::CMaterial::PostProcessing);
|
||||||
|
static const char *program_arbfp10 =
|
||||||
"!!ARBfp1.0\n"
|
"!!ARBfp1.0\n"
|
||||||
"PARAM red = {1.0, 0.0, 0.0, 1.0};\n"
|
"PARAM red = {1.0, 0.0, 0.0, 1.0};\n"
|
||||||
"MOV result.color, red;\n"
|
"MOV result.color, red;\n"
|
||||||
"END\n";
|
"END\n";
|
||||||
a_DevPixelProgram = new CPixelProgram(program);
|
static const char *program_ps10 =
|
||||||
|
"ps.1.1\n"
|
||||||
|
"def c0, 1.0, 0.0, 0.0, 1.0\n"
|
||||||
|
"mov r0, c0\n";
|
||||||
|
a_DevPixelProgram = new CPixelProgram(program_ps10);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,11 +332,14 @@ void updateCommands()
|
||||||
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
||||||
NL3D::IDriver *d = dynamic_cast<NL3D::CDriverUser *>(Driver)->getDriver();
|
NL3D::IDriver *d = dynamic_cast<NL3D::CDriverUser *>(Driver)->getDriver();
|
||||||
d->activePixelProgram(a_DevPixelProgram);
|
d->activePixelProgram(a_DevPixelProgram);
|
||||||
|
bool fogEnabled = d->fogEnabled();
|
||||||
|
d->enableFog(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Driver->drawQuad(CQuad(CVector(x0, y0, 0), CVector(x1, y0, 0), CVector(x1, y1, 0), CVector(x0, y1, 0)), CommandsMaterial);
|
Driver->drawQuad(CQuad(CVector(x0, y0, 0), CVector(x1, y0, 0), CVector(x1, y1, 0), CVector(x0, y1, 0)), CommandsMaterial);
|
||||||
|
|
||||||
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
||||||
|
d->enableFog(fogEnabled);
|
||||||
d->activePixelProgram(NULL);
|
d->activePixelProgram(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue