[SOLVED] weird screen error after using decals ( using shade-c )

Posted By: Reconnoiter

[SOLVED] weird screen error after using decals ( using shade-c ) - 08/21/16 15:13

Hi everyone,

Not sure why but I am getting these weird screen effects after creating several decals, the screen effect moves with the sun angle (cause of shadows maybe?). I use shade-c by the way, maybe its cause of the shader I use for the decal? Here are some pics:





My code the spawn the decals:

Code:
PARTICLE* p = ent_decal(ent, _bmap, _size + random(_size_random), _rota + random(_rota_random)); 
		p.lifespan = _time;
		p.material = mtl_simpleTransparent;
		set(p, TRANSLUCENT);



And here is the shader/fx file of the decal:

Code:
//------------------------------------------------------------------------------
//----- USER INPUT -------------------------------------------------------------
//------------------------------------------------------------------------------

//assign skins
#define SKIN_ALBEDO (skin1.xyz) //diffusemap
#define SKIN_ALPHA (skin1.w) //alphamap
#define SKIN_NORMAL (skin2.xyz) //normalmap
#define SKIN_GLOSS (skin2.w) //glossmap
//...

#define NORMALMAPPING //do normalmapping?

//#define GLOSSMAP //entity has glossmap?

#define ALPHA //entity has alphamap?
////#define TRANSPARENT //entity alpha should be interpreted as transparent/translucent?

//------------------------------------------------------------------------------
// ! END OF USER INPUT !
//------------------------------------------------------------------------------

#include <scHeaderObject>

//custom code goes here

#include <scObject>

Posted By: Anonymous

Re: weird screen error after using decals ( using shade-c ) - 08/24/16 01:38

Is creating them as soft_sprite / soft_particles as fix? Do you need to turn on forward rendering when using the standard particle/decal set?
Posted By: Reconnoiter

Re: weird screen error after using decals ( using shade-c ) - 08/24/16 10:05

Hi Malice tnx for replying. Cause of your reply I did some more tests and it only happens when I fire at a shade-c dynamic light while just standing behind its lightrange. The shade-c lights are valid targets in c_trace's.

I quess it makes sense when I look at the light create code, just suprised they didn't mentionend this in the examples cause its so easy so overlook (this could have created some many bugs lol):

Code:
ENTITY* spotlight2 = sc_light_create(vector(-156,-82,800), 1000, vector(2000,512,0), SC_LIGHT_SPOT | SC_LIGHT_SHADOW);
	spotlight2.pan = 0;
	spotlight2.tilt = -43;
	sc_light_update(spotlight2);



As you see there is an entity created to support the light. My quess is this entity is the cause the bug so I am going to try giving it some flag or otherwise give it a .group number.

-edit, yes it works. laugh
Posted By: Anonymous

Re: weird screen error after using decals ( using shade-c ) - 08/24/16 13:10

Since all lights will be a issue and the flag2 is pointless, I'd add flag2 to all lights and c_trace with ignore_flag2. It's a blanket solution and your going to end up using groups for selective ignoring not blank ignoring...


Ok
© 2024 lite-C Forums