PSSM Shadows with transparency entitie Problem

Posted By: HenWoll

PSSM Shadows with transparency entitie Problem - 01/27/17 07:40

Hi everyone,
Since I dont wanted to spam the [what are you working thread ]
so I start here a new Thread and hope you can help me

I have a strong alpha channel problem with entities when im using PSSM shadows, I have already tried almost all flags, but I get the entites not on ignore the Shadow, The only flag that triggered something was the overlay flag, But it had the appearance that I had the shadow simply inverted around.

I have remove already Shade-c from the Projekt for tested pssm Shadows.


I have also searched the forum afterwards but I have not found any really similar posts.Which surprised me a bit since I seem to be the only one

The 2 models on the view are put on invisible (100% alpha) muzzle fire & reload sprite,To the left of the building you can see an orange lansflare which is also affected by it


and here the same screenshots with the overlay flag


I hope you understand my problem.

here the default main code

Code:
function main() {

   video_mode = 10;
//   video_set(sys_metrics(0),sys_metrics(1),0,1);
   video_set(1024, 768,0, 2);
  	  shadow_stencil = 8; // activate external shadows
  shadow_lod = 1; // works also for PSSM
//   def_move();
  for(you = ent_next(NULL); you; you = ent_next(you)) 
    set(you,SHADOW);


// adjust camera and bias, activate PSSM 
  camera.clip_far = 11000;
  camera.clip_near = 1;
  pssm_fbias = 0.004;
  pssm_run(4);
	mat_shadow.alpha = 25; //transparency of dynamic shadows		
	shadow_mode = IGNORE_SPRITES+IGNORE_PASSABLE+IGNORE_PASSENTS+IGNORE_PASSENTS;

	shadow_threshold = 80;	// 80
	shadow_offset = 2.5;

	mouse_map = mouse;
	max_entities = 2000;
	camera.arc = 70; // set camera.arc to a proper value for shooter games
	fps_max = 80; // limit the frame rate to 75 fps (not really needed)


	wait(1);



so and here the flags from the muzzle fire model

Code:
function set_weaponMuzzle()
{
	//set(my,PASSABLE | LIGHT );
set(my,PASSABLE | TRANSLUCENT | BRIGHT |LIGHT|ZNEAR|OVERLAY|PASS_SOLID);
//set(my,PASSABLE | TRANSLUCENT | BRIGHT | PASS_SOLID |OVERLAY|LIGHT| NOSHADOW| FLAG2|SHADOW| ZNEAR);
//	set(my,PASSABLE | TRANSLUCENT | BRIGHT | ZNEAR);
	my->alpha = 0;
//	my->ambient = -50;
	
	while(player)
	{
		if(weapon_active > 0 && my->alpha > 0)
		{
			
			my->alpha -= 50 * time_step;
			my->lightrange = 150;
		}
		else
		{
			my->alpha = 0;
			my->lightrange = 0;
		}
		wait(1);
	}
}

Posted By: sivan

Re: PSSM Shadows with transparency entitie Problem - 01/27/17 10:42

Hi,
do you use mirror shader in the level?
I while ago I reported a bug related to transparent/overlay shadows (using the stencil buffer like the pssm shadows) when mirror is created in the scene. I think it has not been resolved properly, but don't remember exactly, it was at least 2 years ago.
Posted By: HenWoll

Re: PSSM Shadows with transparency entitie Problem - 01/27/17 11:21

I bet this is a really simple error of me here,

Quote:
Hi,
do you use mirror shader in the level?
I while ago I reported a bug related to transparent/overlay shadows (using the stencil buffer like the pssm shadows) when mirror is created in the scene. I think it has not been resolved properly, but don't remember exactly, it was at least 2 years ago.


i tested this without any Shaders, ore somthing,
Here is a simple Level with the same Bug
But thanx for the awneser









Posted By: Ayumi

Re: PSSM Shadows with transparency entitie Problem - 01/27/17 16:16

We have solved the problem via skype.

Set in shadow.c NOFLAG1.
viewShadow->flags |= SHOW|UNTOUCHABLE|NOSHADOW|NOPARTICLE|NOLOD|NOSKY|NOFLAG1;

All entities to be ignored get flag1 and it works.
© 2024 lite-C Forums