mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-19 13:46:13 +00:00
Add test for ps.1.1 pixel program in snowballs (it works too now)
This commit is contained in:
parent
7e35bea71f
commit
52b9637167
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
|
||||
* stage and the whole is multiplied by the alpha in color vertex [AT0*ADiffuseCol+AT1*(1-ADiffuseCol)]*AStage
|
||||
* - 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,
|
||||
Bump,
|
||||
|
@ -183,6 +188,7 @@ public:
|
|||
PerPixelLightingNoSpec,
|
||||
Cloud,
|
||||
Water,
|
||||
PostProcessing,
|
||||
shaderCount};
|
||||
|
||||
/// \name Texture Env Modes.
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include <nel/3d/driver_user.h>
|
||||
#include <nel/3d/driver.h>
|
||||
#include <nel/3d/pixel_program.h>
|
||||
#include <nel/3d/material.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -292,12 +293,17 @@ void initCommands()
|
|||
CommandsMaterial.setBlend(true);
|
||||
|
||||
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
||||
static const char *program =
|
||||
CommandsMaterial.getObjectPtr()->setShader(NL3D::CMaterial::PostProcessing);
|
||||
static const char *program_arbfp10 =
|
||||
"!!ARBfp1.0\n"
|
||||
"PARAM red = {1.0, 0.0, 0.0, 1.0};\n"
|
||||
"MOV result.color, red;\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
|
||||
}
|
||||
|
||||
|
@ -326,11 +332,14 @@ void updateCommands()
|
|||
#if SBCLIENT_DEV_PIXEL_PROGRAM
|
||||
NL3D::IDriver *d = dynamic_cast<NL3D::CDriverUser *>(Driver)->getDriver();
|
||||
d->activePixelProgram(a_DevPixelProgram);
|
||||
bool fogEnabled = d->fogEnabled();
|
||||
d->enableFog(false);
|
||||
#endif
|
||||
|
||||
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
|
||||
d->enableFog(fogEnabled);
|
||||
d->activePixelProgram(NULL);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue