How to works with target_setinfluence [mtrWorld]?

Started by bitterman, September 05, 2018, 08:17:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitterman

Can  anyone explaine (in simple words or examples) how works these features?

Looks like "mtrVision" affects only on player's view.
Totally don't understand what they had in mind about "mtrWorld" "material to globally replace in the world"". Where in the world? On each model or brush?

Is this features will change view of each model or it will affected on whole player's view (as if we were just looking through colored glass)?

Thanks!

Quote
entityDef target_setinfluence {

    "editor_var mtrVision"    "material to show during vision effects, if visionRadius is set the alpha channel of the material scales from 0 to 1 based on radius proximity of the player to the influence"

    "editor_var mtrWorld"    "material to globally replace in the world"
    "editor_var visionRadius"    "radius to effect vision effects with, mtrVision will always be used ( if it is set ) but this will also double the vision based on the radius"

}

The Happy Friar

mtrWorld changes to that material everything in the world I think.  I used it once or twice and I believe that's what it was designed to do.

bitterman

#2
Thanks THF!

mtrWorld not used in vanilla assets.

Looks like this feature works as if all objects in the player's view are autosprites.

At picture 3.jpg can see same scene as 2.jpg but with apply 4.jpeg as mtrWotld.

As I remember same warning causes if we try to apply deform sprite to complex mesh (not to plane/path with four vertex only).

That it's looks in the Code:
parm = spawnArgs.GetString( "mtrWorld" );
if ( parm && *parm ) {
gameLocal.SetGlobalMaterial( declManager->FindMaterial( parm ) );
}


/*
================
idGameLocal::SetGlobalMaterial
================
*/
void idGameLocal::SetGlobalMaterial( const idMaterial *mat ) {
globalMaterial = mat;
}


/*
===============
R_GlobalShaderOverride
===============
*/
bool R_GlobalShaderOverride( const idMaterial **shader ) {

if ( !(*shader)->IsDrawn() ) {
return false;
}

if ( tr.primaryRenderView.globalMaterial ) {
*shader = tr.primaryRenderView.globalMaterial;
return true;
}

if ( r_materialOverride.GetString()[0] != '\0' ) {
*shader = declManager->FindMaterial( r_materialOverride.GetString() );
return true;
}

return false;
}


bitterman

I was wrong about autosprite (those mtr already has deform sprite).

As THF says above looks like mtrWorld just allow to apply specified material to all faces in the scene.

A matrix-style view can be acheived :)

bitterman


The Happy Friar

That's a cool idea to use it for.  :)  I never got to messing with the target_setinfluence because i couldn't ever imagine what i would use it for.

bitterman