Author Topic: How to works with target_setinfluence [mtrWorld]?  (Read 83 times)

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 317
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
How to works with target_setinfluence [mtrWorld]?
« on: September 05, 2018, 08:17:03 AM »
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"

}
« Last Edit: September 09, 2018, 12:50:33 AM by bitterman »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 914
  • Karma: +43/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: How to works with target_setinfluence?
« Reply #1 on: September 06, 2018, 09:36:58 PM »
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

  • Sr. Member
  • ****
  • Posts: 317
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to works with target_setinfluence?
« Reply #2 on: September 09, 2018, 12:47:06 AM »
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:
Code: [Select]
parm = spawnArgs.GetString( "mtrWorld" );
if ( parm && *parm ) {
gameLocal.SetGlobalMaterial( declManager->FindMaterial( parm ) );
}

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

Code: [Select]
/*
===============
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;
}
« Last Edit: September 09, 2018, 12:49:00 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 317
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to works with target_setinfluence [mtrWorld]?
« Reply #3 on: September 09, 2018, 03:40:56 AM »
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

  • Sr. Member
  • ****
  • Posts: 317
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to works with target_setinfluence [mtrWorld]?
« Reply #4 on: September 09, 2018, 09:52:38 AM »
With "scroll" key, but looks poor.

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 914
  • Karma: +43/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: How to works with target_setinfluence [mtrWorld]?
« Reply #5 on: September 09, 2018, 04:15:58 PM »
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

  • Sr. Member
  • ****
  • Posts: 317
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to works with target_setinfluence [mtrWorld]?
« Reply #6 on: September 10, 2018, 12:02:54 PM »
Welcome to System Shock 2 (animated gif) :)