virtualboolsetUniformDriver(TProgramprogram)=0;// set all driver-specific features params (based on program->features->DriverFlags) (called automatically when rendering with cmaterial and using a user program)
virtualboolsetUniformDriver(TProgramprogram)=0;// set all driver-specific features params (based on program->features->DriverFlags) (called automatically when rendering with cmaterial and using a user program)
virtualboolsetUniformMaterial(TProgramprogram,CMaterial&material)=0;// set all material-specific feature params (based on program->features->MaterialFlags) (called automatically when rendering with cmaterial and using a user program)
virtualboolsetUniformMaterial(TProgramprogram,CMaterial&material)=0;// set all material-specific feature params (based on program->features->MaterialFlags) (called automatically when rendering with cmaterial and using a user program)
virtualvoidsetUniformParams(TProgramprogram,CGPUProgramParams¶ms)=0;// set all user-provided params from the storage
virtualvoidsetUniformParams(TProgramprogram,CGPUProgramParams¶ms)=0;// set all user-provided params from the storage
// Return true if uniforms are kept as program state and switched together with programs, false if uniforms are driver state and stay accross program switches.
/// Driver ambient, must be ignored when material ambient is flagged
//DriverAmbient = 0x00001000,
/// Lights, does not set diffuses if material lights is flagged
//DriverLights = 0x00002000,
// etcetera
// Fog (todo)
// Fog = ...,
};
};
uint32DriverFlags;
uint32DriverFlags;
// uint NumLights; // number of lights supported by the program (not used yet, modify as necessary)
// uint NumLights;
enumTMaterialFlags
enumTMaterialFlags
{
{
/// Use the CMaterial texture stages as the textures for a Pixel Program
/// Use the CMaterial texture stages as the textures for a Pixel Program
TextureStages=0x00000001,// <- don't remove this one, it's already used, if you want to split them up into the different stages, then it's ok to change it
TextureStages=0x00000001,
TextureMatrices=0x00000002,
TextureMatrices=0x00000002,
//
// Rough example, modify as necessary.
//
// Lighting (todo)
/// Material ambient premultiplied with driver ambient
//MaterialAmbient = 0x00000002,
/// Premultiply lights diffuse with material diffuse, requires driver lights to be flagged
//MaterialLights = 0x00000004,
// etcetera
// Add all necessary feature sets used with builtin materials here
};
};
// Material builtin parameters
// Material builtin parameters
uint32MaterialFlags;
uint32MaterialFlags;
};
};
/// Stucture used to cache the indices of builtin parameters
// Stucture used to cache the indices of builtin parameters which are used by the drivers
structCGPUProgramIndices
// Not used for parameters of specific nl3d programs
virtualboolsetUniformDriver(TProgramprogram);// set all driver-specific features params (based on program->features->DriverFlags)
virtualboolsetUniformDriver(TProgramprogram);// set all driver-specific features params (based on program->features->DriverFlags)
virtualboolsetUniformMaterial(TProgramprogram,CMaterial&material);// set all material-specific feature params (based on program->features->MaterialFlags)
virtualboolsetUniformMaterial(TProgramprogram,CMaterial&material);// set all material-specific feature params (based on program->features->MaterialFlags)
virtualvoidsetUniformParams(TProgramprogram,CGPUProgramParams¶ms);// set all user-provided params from the storage
virtualvoidsetUniformParams(TProgramprogram,CGPUProgramParams¶ms);// set all user-provided params from the storage
virtualboolsetUniformMaterial(TProgramprogram,CMaterial&material);// set all material-specific feature params (based on program->features->MaterialFlags)
virtualboolsetUniformMaterial(TProgramprogram,CMaterial&material);// set all material-specific feature params (based on program->features->MaterialFlags)
boolsetUniformMaterialInternal(TProgramprogram,CMaterial&material);// set all material-specific feature params (based on program->features->MaterialFlags)
boolsetUniformMaterialInternal(TProgramprogram,CMaterial&material);// set all material-specific feature params (based on program->features->MaterialFlags)
virtualvoidsetUniformParams(TProgramprogram,CGPUProgramParams¶ms);// set all user-provided params from the storage
virtualvoidsetUniformParams(TProgramprogram,CGPUProgramParams¶ms);// set all user-provided params from the storage
nlwarning("Missing 'modelViewProjectionInverseTranspose' in gpu program '%s', ModelViewProjectionInverseTranspose disabled",source->DisplayName.c_str());
// drv->setUniformMatrix(IDriver::VertexProgram, program->indices().ModelViewProjection, IDriver::ModelViewProjection, IDriver::Identity); // now set by setUniformDriver in setupMaterial