Raised This Month: $32 Target: $400
 8% 

Solved set_user_rendering thickness issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 09-03-2018 , 12:00   set_user_rendering thickness issue
Reply With Quote #1

Hi guys,

I am using set_user_rendering to create a glowing shell around the players. The issue is that even though the "amount" argument is set to 25, the glow is way too thick.

My code:

PHP Code:
set_user_rendering(idkRenderFxGlowShell00255kRenderNormal25); 
Outcome:



Using: AMX Mod X v1.8.3-dev+4932

What might be the problem?

Thank you for your time.

Edit:

The problem was because of the semiclip. See my last post in this thread.
__________________
We all live under the same sky but we have different horizons.

Last edited by bLacK-bLooD; 09-03-2018 at 13:31.
bLacK-bLooD is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 09-03-2018 , 12:04   Re: set_user_rendering thickness issue
Reply With Quote #2

Nope, it's working well, player height is 72, so 25 should be as shown on image
Btw its float value
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 09-03-2018 at 12:05.
Ghosted is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 09-03-2018 , 12:10   Re: set_user_rendering thickness issue
Reply With Quote #3

Hmm, I should ask myself some questions then.

How would I make the shell to be very very thin, but very colored. I just want the outline of the player to be colored. If I set the amount to 1, I can barely see anything on the player.
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-03-2018 , 12:42   Re: set_user_rendering thickness issue
Reply With Quote #4

The glow in the picture does not match the code you gave. It's not even the same color. The picture clearly has pure blue (0, 0, 255) and not (0, 100, 255). Are you sure you set the amount to 25 and not 255?

I tested your code and here are the results:

25 - https://i.imgur.com/0ivJIzX.jpg
255 - https://i.imgur.com/49Jjqpd.jpg

Are you sure your code is compiled?
__________________

Last edited by OciXCrom; 09-03-2018 at 12:43.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 09-03-2018 , 13:03   Re: set_user_rendering thickness issue
Reply With Quote #5

This is the full code. It's the last line of code that sets the rendering. The plugin is basically the original plugin which you can find here:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>

#define PLUGIN "Glowing Color By Speed"
#define VERSION "1.0"
#define AUTHOR "Garey"

#define FREQ 0.1

new bool:plrGlow[33] = { true, ... };

new 
TaskEnt,g_glowamount,g_minspeed,g_maxspeedmaxplayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("Garey""Glowing Color By Speed"FCVAR_SERVER)
    
register_forward(FM_Think"Think")
    
    
TaskEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))    
    
set_pev(TaskEntpev_classname"speedometer_think")
    
set_pev(TaskEntpev_nextthinkget_gametime() + 1.01)
    
    
g_glowamount=register_cvar("gbs_amount""25")
    
g_minspeed=register_cvar("gbs_glow_min_speed""250")
    
g_maxspeed=register_cvar("gbs_glow_max_speed""1500")
    
    
maxplayers get_maxplayers()
}

public 
Think(ent)
{
    if(
ent == TaskEnt
    {
        
SpeedTask()
        
set_pev(entpev_nextthink,  get_gametime() + FREQ)
    }
}

public 
client_putinserver(id)
{
    
plrGlow[id] = true
}

stock dynamicColor(min,max,Float:value,&red,&green,&blue)
//Don`t launch with max ~= min 
    #define MaxC 255
    #define MinC 0
    #define DtC 255
    
    
if (value>=max)
    {
        
red=MaxC;
        
green=MinC;
        
blue=MinC;
        return;
    }
    else if (
value<=min)
    {
        
red=MinC;
        
green=MinC;
        
blue=MaxC;
        return;
    }
    
    new 
Float:step = (max-min)/4.0;
    new 
Float:dt value-min;
    
    if (
dt <= step)
    {
        
red   MinC;
        
green floatround(dt*(DtC/step));
        
blue  MaxC;
    }
    else if (
dt-=stepdt <= step)
    {
        
red   MinC;
        
green MaxC;
        
blue  floatround((step-dt)*(DtC/step));
    }
    else if (
dt-=stepdt <= step)
    {
        
red   floatround(dt*(DtC/step));
        
green MaxC;
        
blue  MinC;
    }
    else
    {
        
dt-=step;
        
red   MaxC;
        
green floatround((step-dt)*(DtC/step));
        
blue  MinC;
    }
    return;
}


SpeedTask()
{
static 
itarget
static Float:velocity[3]
static 
Float:speedh

for(i=1i<=maxplayersi++)
{
    if(!
is_user_alive(i)) continue
    if(!
plrGlow[i]) continue
    
    
target pev(ipev_iuser1) == pev(ipev_iuser2) : i
    pev
(targetpev_velocityvelocity)
    
    
speedh floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
    
    static 
rgb
    dynamicColor
(get_pcvar_num(g_minspeed),get_pcvar_num(g_maxspeed),speedh,r,g,b)
    
set_user_rendering(ikRenderFxGlowShellr,,kRenderNormalget_pcvar_num(g_glowamount))
}

Edit: While if I look at the player, the glow is very thick, if I look at myself I get the wanted result (it's a very thin glow). I am using a 3rd person view plugin to see myself.

Picture:

__________________
We all live under the same sky but we have different horizons.

Last edited by bLacK-bLooD; 09-03-2018 at 13:08.
bLacK-bLooD is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 09-03-2018 , 13:09   Re: set_user_rendering thickness issue
Reply With Quote #6

Are you using semiclip?
__________________
Airkish is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 09-03-2018 , 13:10   Re: set_user_rendering thickness issue
Reply With Quote #7

Quote:
Originally Posted by Airkish View Post
Are you using semiclip?
Yes, I am using a ProKreedz, which has semiclip.

However, the value of semiclip is set to 255, therefore fully visible.

Might that be why?

Edit:

If I turn the semiclip cvar off, the glow works. However, due to the mod of my server, I really need the semiclip so players don't bump into each other.

Is there a way to keep the semiclip but also to have the nice glow effect?

Edit 2:

Fixed. Just disable these 2 lines (which disable the transparency option in prokreedz). This will make the outer shell of the player look good.

PHP Code:
// set_es(es, ES_RenderMode, kRenderTransAlpha)
// set_es(es, ES_RenderAmt, get_pcvar_num(kz_semiclip_transparency)) 
__________________
We all live under the same sky but we have different horizons.

Last edited by bLacK-bLooD; 09-03-2018 at 13:26.
bLacK-bLooD is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode