Filter shadow

#1
Hi guys. I've got my own flashlight system but sometimes it become a real problem because of player's shadow. I'd like to ignore player's shadow only for my own flashlight. How to do that?
Any help'd be appreciated.

Re: Filter shadow

#2
Hi guys. I've got my own flashlight system but sometimes it become a real problem because of player's shadow. I'd like to ignore player's shadow only for my own flashlight. How to do that?
Any help'd be appreciated.
i'm kind interested too in that, because i have some sort of problem with a custom flashlight walking back flashlight produce shadows
Image

Re: Filter shadow

#3
Hi I think the engine not supported LightMasks at all for all kind of the Lights, this feature allows manipulating light's affection on object in scene in per-object basis. Mb I'm wrong about that...

But you still may fully disable all shadows for some object by using m_pEntity->SetSlotFlags()

Code: Select all

m_pEntity->LoadGeometry(0, "Assets\\Objects\\someobject.cgf");
//uint32 flags = GetEntity()->GetFlags();
uint32 flags = ENTITY_SLOT_RENDER & ~ENTITY_SLOT_CAST_SHADOW;
GetEntity()->SetSlotFlags(0, flags);
Last edited by MoonBeam on Fri Oct 19, 2018 2:19 pm, edited 1 time in total.

Re: Filter shadow

#4
Hi I think the engine not supported LightMasks at all for all kind of the Lights, this feature allows manipulating light's affection on object in scene in per-object basis. Mb I'm wrong about that...

But you still may fully disable all shadows for some object by using m_pEntity->SetSlotFlags()

Code: Select all

m_pEntity->LoadGeometry(0, "Assets\\Objects\\someobject.cgf");
uint32 flags = GetEntity()->GetFlags();
uint32 flags = ENTITY_SLOT_RENDER & ~ENTITY_SLOT_CAST_SHADOW;
GetEntity()->SetSlotFlags(0, flags);
You are wrong :)

ILightSource interface has this function:

Code: Select all

virtual void SetCastingException(IRenderNode* pNotCaster) = 0;
You pass it the render node of the object that you don't want to cast shadows from that light source and that's it.
My Youtube Channel

Re: Filter shadow

#5
as far as i know it is a problem between first-person and third person shadow rendering wich are in some way in conflict and produce that issue, if i'm not wrong they fixed that with 5.4/5.5 i will ask is there is any solution before release my project during optimization
Image

Re: Filter shadow

#6
You are wrong :)
That's great! Perhaps then I need test this feature someday, but the main question is - why this abbility of the ILightsSource not part of standart user's interface for LightComponent's in sandbox property panel ? It should be in properties, that user can tweak.

Re: Filter shadow

#7
You are wrong :)
That's great! Perhaps then I need test this feature someday, but the main question is - why this abbility of the ILightsSource not part of standart user's interface for LightComponent's in sandbox property panel ? It should be in properties, that user can tweak.
Yeh. I totally agree. Cryengine is a very capable engine but some capabilities like this one are not easily accessible. It should be in the properties but it's not. Maybe in the future :)
My Youtube Channel

Re: Filter shadow

#8
You are wrong :)
That's great! Perhaps then I need test this feature someday, but the main question is - why this abbility of the ILightsSource not part of standart user's interface for LightComponent's in sandbox property panel ? It should be in properties, that user can tweak.
Yeh. I totally agree. Cryengine is a very capable engine but some capabilities like this one are not easily accessible. It should be in the properties but it's not. Maybe in the future :)
Guys, thanks for the effort you showed.
Ghost, could you please give me a tip about to express an entity as a light source if you know? I've just simply spawned an entity(light) and as you know, I can't make ILightSource equal to IEntity. They are completely different things.

Re: Filter shadow

#9
could you please give me a tip about to express an entity as a light source if you know?
I think you need write code something like this, but I'am not for sure

Code: Select all

SEntitySlotInfo slotLightInfo;
m_pEntity->GetSlotInfo(nLightSlot, slotLightInfo);
ILightSource* pLightSource = slotLightInfo.pLight;

Re: Filter shadow

#10
could you please give me a tip about to express an entity as a light source if you know?
I think you need write code something like this, but I'am not for sure

Code: Select all

SEntitySlotInfo slotLightInfo;
m_pEntity->GetSlotInfo(nLightSlot, slotLightInfo);
ILightSource* pLightSource = slotLightInfo.pLight;
I'll try it. Thank you, though.

Who is online

Users browsing this forum: No registered users and 1 guest