GetPlayerRender exist?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

GetPlayerRender exist?

#1

Post by ibm5155 » Thu Apr 11, 2013 12:18 pm

There´s some acs command that could get the player render like:return 0 if software and 1 if opengl.

I think this would be userfull for maps that just use dynamic lights for lighting the map ex:

Code: Select all

script 1  open clientside
{
 if(GetPlayerRender()==0)
  {
    Light_ChangeToValue(1,133);
    Light_ChangeToValue(2,255);
    Light_ChangeToValue(3,133);
    Light_ChangeToValue(4,200);
    Light_ChangeToValue(5,255);
    Set_sectorlight(1,CR_RED);//don´t remember now the code to change the type of light
    set_sectorlight(3,CR_GREEN);
    set_sectorlight(5,CR_YELLOW);
  }
}
That script would let software players with the same (or almost the same) experience as opengl users with opengl, but opengl would have better looking maps because that lights are only dynamic lights and software users would have a map that´s playable with almost the same result as the opengl user...

But for all that it´s required that GetPlayerRender exist :s
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: GetPlayerRender exist?

#2

Post by Ænima » Thu Apr 11, 2013 12:24 pm

Super Skulltag uses this in a few maps, usually to disable the fancy "light beam" textures for software players because textures with PNG alpha channel look horrible in software.

Code: Select all

script 256 ENTER CLIENTSIDE
{
int usesoftware = GetCVar ("vid_renderer");

	if (usesoftware == 0) 
	{
    	 ReplaceTextures("TRANLITE","TNT1A0");
	}
}
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: GetPlayerRender exist?

#3

Post by ibm5155 » Thu Apr 11, 2013 1:24 pm

hmm thanks Ænima, then GetPlayerRender can exist :D

Code: Select all

function int GetPlayerRender(void)
{
return GetCVar ("vid_renderer");
}
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: GetPlayerRender exist?

#4

Post by Ijon Tichy » Thu Apr 11, 2013 2:40 pm

actually, what you should do is GetCVar("vid_renderer") && !GetCVar("gl_nogl")

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: GetPlayerRender exist?

#5

Post by Ænima » Thu Apr 11, 2013 3:27 pm

Ijon Tichy wrote: actually, what you should do is GetCVar("vid_renderer") && !GetCVar("gl_nogl")
Wait, why? That seems a bit redundant.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: GetPlayerRender exist?

#6

Post by ibm5155 » Thu Apr 11, 2013 3:51 pm

Ijon Tichy wrote: actually, what you should do is GetCVar("vid_renderer") && !GetCVar("gl_nogl")
?

but GetCVar("vid_renderer") return 0 if it´s software render and 1 if it´s opengl, what should be "gl_nogl"?
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: GetPlayerRender exist?

#7

Post by Ijon Tichy » Thu Apr 11, 2013 4:18 pm

gl_nogl disables the GL renderer, even if vid_renderer is 1

gl_nogl isn't saved in the INI, I don't think; hence it's not used very often

even if it is, vid_renderer does the job better, but regardless, you have to account for nogl
Last edited by Ijon Tichy on Thu Apr 11, 2013 4:22 pm, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: GetPlayerRender exist?

#8

Post by Ænima » Thu Apr 11, 2013 4:34 pm

Ahhh. Okay. Thanks for pointing that out.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: GetPlayerRender exist?

#9

Post by ibm5155 » Thu Apr 11, 2013 5:30 pm

The idea is good too :)

But what I wanted is do a opengl map be playable on software render, but not affecting the quality of the opengl gameplay ex:

[spoiler]opengl
Image
software before the getplayerRender
Image
software with GetPlayerRender
Image[/spoiler]
It´s not the same result as in opengl but it´s playable on soft :)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: GetPlayerRender exist?

#10

Post by Ijon Tichy » Thu Apr 11, 2013 6:05 pm

... okay?

so use this, since it checks the other cvar that decides which renderer you use

Code: Select all

function int ConsolePlayerRenderer(void) { return GetCVar("vid_renderer") > 0 && GetCVar("gl_nogl") <= 0); }

Post Reply