本文整理汇总了C++中shaderCommands_t::currentStageIteratorFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ shaderCommands_t::currentStageIteratorFunc方法的具体用法?C++ shaderCommands_t::currentStageIteratorFunc怎么用?C++ shaderCommands_t::currentStageIteratorFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shaderCommands_t
的用法示例。
在下文中一共展示了shaderCommands_t::currentStageIteratorFunc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RB_EndSurface
/*
** RB_EndSurface
*/
void RB_EndSurface( void ) {
shaderCommands_t *input;
input = &tess;
if (input->numIndexes == 0 || input->numVertexes == 0) {
return;
}
if (input->indexes[SHADER_MAX_INDEXES-1] != 0) {
ri.Error (ERR_DROP, "RB_EndSurface() - SHADER_MAX_INDEXES hit");
}
if (input->xyz[SHADER_MAX_VERTEXES-1][0] != 0) {
ri.Error (ERR_DROP, "RB_EndSurface() - SHADER_MAX_VERTEXES hit");
}
if ( tess.shader == tr.shadowShader ) {
RB_ShadowTessEnd();
return;
}
// for debugging of sort order issues, stop rendering after a given sort value
if ( r_debugSort->integer && r_debugSort->integer < tess.shader->sort ) {
return;
}
//
// update performance counters
//
backEnd.pc.c_shaders++;
backEnd.pc.c_vertexes += tess.numVertexes;
backEnd.pc.c_indexes += tess.numIndexes;
backEnd.pc.c_totalIndexes += tess.numIndexes * tess.numPasses;
//
// call off to shader specific tess end function
//
tess.currentStageIteratorFunc();
//
// draw debugging stuff
//
if ( r_showtris->integer ) {
DrawTris (input);
}
if ( r_shownormals->integer ) {
DrawNormals (input);
}
// clear shader so we can tell we don't have any unclosed surfaces
tess.numIndexes = 0;
tess.numVertexes = 0;
tess.firstIndex = 0;
tess.multiDrawPrimitives = 0;
GLimp_LogComment( "----------\n" );
}
示例2: RB_EndSurface
/*
===================
RB_EndSurface
===================
*/
void RB_EndSurface(void)
{
shaderCommands_t *input = &tess;
if (input->numIndexes == 0)
{
return;
}
if (input->indexes[input->maxShaderIndicies - 1] != 0)
{
ri.Error(ERR_DROP, "RB_EndSurface() - input->maxShaderIndicies(%i) hit", input->maxShaderIndicies);
}
if (input->xyz[input->maxShaderVerts - 1].v[0] != 0)
{
ri.Error(ERR_DROP, "RB_EndSurface() - input->maxShaderVerts(%i) hit", input->maxShaderVerts);
}
if (tess.shader == tr.shadowShader)
{
RB_ShadowTessEnd();
return;
}
// for debugging of sort order issues, stop rendering after a given sort value
if (r_debugSort->integer && r_debugSort->integer < tess.shader->sort)
{
return;
}
// update performance counters
backEnd.pc.c_shaders++;
backEnd.pc.c_vertexes += tess.numVertexes;
backEnd.pc.c_indexes += tess.numIndexes;
backEnd.pc.c_totalIndexes += tess.numIndexes * tess.numPasses;
// call off to shader specific tess end function
tess.currentStageIteratorFunc();
// draw debugging stuff
if (r_showtris->integer)
{
DrawTris(input);
}
if (r_shownormals->integer)
{
DrawNormals(input);
}
// clear shader so we can tell we don't have any unclosed surfaces
tess.numIndexes = 0;
GLimp_LogComment("----------\n");
}
示例3: RB_MaskTessEnd
void RB_MaskTessEnd( void ) {
shaderCommands_t *input;
input = &tess;
//qglClear( GL_COLOR_BUFFER_BIT );
qglColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
qglDepthMask(GL_FALSE);
qglEnable(GL_STENCIL_TEST);
qglClearStencil(0);
qglClear(GL_STENCIL_BUFFER_BIT);
qglStencilFunc(GL_ALWAYS,1,1);
qglStencilOp(GL_KEEP,GL_KEEP,GL_REPLACE);
tess.currentStageIteratorFunc();
qglDepthMask(GL_TRUE);
qglColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
qglStencilFunc(GL_EQUAL,1,1);
qglStencilOp(GL_KEEP,GL_KEEP,GL_KEEP);
}
示例4: RB_EndSurface
//.........这里部分代码省略.........
RB_MaskTessEnd();
return;
}
// for debugging of sort order issues, stop rendering after a given sort value
if ( r_debugSort->integer && r_debugSort->integer < tess.shader->sort ) {
return;
}
//
// update performance counters
//
backEnd.pc.c_shaders++;
backEnd.pc.c_vertexes += tess.numVertexes;
backEnd.pc.c_indexes += tess.numIndexes;
backEnd.pc.c_totalIndexes += tess.numIndexes * tess.numPasses;
if(forceDepth) {
//Force depth testing if we are rendering via draw.Start3D -Hxrmn
size = sizeof(tess.xstages) / sizeof(tess.xstages[0]);
for(i=0; i<size; i++) {
if(tess.xstages[i] != NULL) {
if(tess.xstages[i]->stateBits & GLS_DEPTHTEST_DISABLE) {
tess.xstages[i]->stateBits &= ~GLS_DEPTHTEST_DISABLE;
}
}
}
}
//
// call off to shader specific tess end function
//
if(tess.shader->GLSL) {
prog = getShaderProgram(tess.shader->GLSLName);
if(prog != -1) {
qglUseProgramObjectARB(prog);
if(qglUniform1fARB) {
loc = qglGetUniformLocationARB(prog, "cgtime");
qglUniform1fARB(loc, backEnd.refdef.floatTime);
}
if(qglUniform3fvARB) {
loc = qglGetUniformLocationARB(prog, "viewPos");
qglUniform3fARB(loc,
backEnd.refdef.vieworg[0],
backEnd.refdef.vieworg[1],
backEnd.refdef.vieworg[2]);
}
if(qglUniform3fvARB) {
loc = qglGetUniformLocationARB(prog, "viewNormal");
qglUniform3fARB(loc,
backEnd.refdef.viewaxis[0][0],
backEnd.refdef.viewaxis[0][1],
backEnd.refdef.viewaxis[0][2]);
}
if(qglUniform2fARB) {
loc = qglGetUniformLocationARB(prog, "fov");
qglUniform2fARB(loc,
backEnd.refdef.fov_x,
backEnd.refdef.fov_y);
}
/*
loc = qglGetUniformLocationARB(prog, "texture_0");
qglUniform1iARB(loc, 0);
loc = qglGetUniformLocationARB(prog, "texture_1");
qglUniform1iARB(loc, 1);*/
}
}
//tess.shader->stages[0]->bundle[0].image
tess.currentStageIteratorFunc();
if(tess.shader->GLSL) {
revertShaderProgram();
qglDisable(GL_TEXTURE0_ARB);
qglDisable(GL_TEXTURE1_ARB);
qglDisable(GL_TEXTURE2_ARB);
qglDisable(GL_TEXTURE3_ARB);
}
//
// draw debugging stuff
//
if ( r_showtris->integer ) {
DrawTris (input);
}
if ( r_shownormals->integer ) {
DrawNormals (input);
}
// clear shader so we can tell we don't have any unclosed surfaces
tess.numIndexes = 0;
GLimp_LogComment( "----------\n" );
}
示例5: RB_EndSurface
/*
** RB_EndSurface
*/
void RB_EndSurface( void ) {
shaderCommands_t *input;
input = &tess;
if (input->numIndexes == 0) {
return;
}
if (input->indexes[SHADER_MAX_INDEXES-1] != 0) {
Com_Error (ERR_DROP, "RB_EndSurface() - SHADER_MAX_INDEXES hit");
}
if (input->xyz[SHADER_MAX_VERTEXES-1][0] != 0) {
Com_Error (ERR_DROP, "RB_EndSurface() - SHADER_MAX_VERTEXES hit");
}
if ( tess.shader == tr.shadowShader ) {
RB_ShadowTessEnd();
return;
}
// for debugging of sort order issues, stop rendering after a given sort value
if ( r_debugSort->integer && r_debugSort->integer < tess.shader->sort ) {
return;
}
if ( skyboxportal )
{
// world
if(!(backEnd.refdef.rdflags & RDF_SKYBOXPORTAL))
{
if(tess.currentStageIteratorFunc == RB_StageIteratorSky)
{ // don't process these tris at all
return;
}
}
// portal sky
else
{
if(!drawskyboxportal)
{
if( !(tess.currentStageIteratorFunc == RB_StageIteratorSky))
{ // /only/ process sky tris
return;
}
}
}
}
//
// update performance counters
//
backEnd.pc.c_shaders++;
backEnd.pc.c_vertexes += tess.numVertexes;
backEnd.pc.c_indexes += tess.numIndexes;
backEnd.pc.c_totalIndexes += tess.numIndexes * tess.numPasses;
if (tess.fogNum && tess.shader->fogPass && r_drawfog->value == 1)
{
backEnd.pc.c_totalIndexes += tess.numIndexes;
}
//
// call off to shader specific tess end function
//
tess.currentStageIteratorFunc();
//
// draw debugging stuff
//
if ( r_showtris->integer ) {
DrawTris (input);
}
if ( r_shownormals->integer ) {
DrawNormals (input);
}
// clear shader so we can tell we don't have any unclosed surfaces
tess.numIndexes = 0;
GLimp_LogComment( "----------\n" );
}