Problem with Q3 Shaders lightning

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
nCore
Posts: 3
Joined: Fri Jul 05, 2013 8:00 pm
Location: Poland

Problem with Q3 Shaders lightning

Post by nCore »

Hello everyone!

First of all, thanks for such a powerful engine, guys, you rock! :) I can't get out off my computer :P

I have a "little" problem with quake3 shaders, namely:

The problem with lightning on BSP was solved "some" time ago, I can't remember exactly, but as far as I know shaders were not.

I've "attached" the dynamic light to my camera position, when I move, the dynamic light moves with me.

Here's the proof (q3dm6 map loaded from Quake III Arena game):
Image

Material types (with lightning set to true):
BSP and Q3ShaderNode: EMT_LIGHTMAP_LIGHTNING_M4 - problem: BSP receives dynamic light, shaders don't

And the second one:
Image

Material types (with lightning set to true):
BSP: EMT_LIGHTMAP_ADD, Q3ShaderNode: EMT_LIGHTMAP_LIGHTNING_M4 - problem: BSP untouched (only with added some more light), shaders don't receive dynamic lights.

I tried many different solutions found on this forum and for about 3 days I can't find real solution for that problem. Is this Irrlicht's problem, or just me doing something wrong? Can somebody point me to the right direction?

Thanks in advance, David.
nCore
Posts: 3
Joined: Fri Jul 05, 2013 8:00 pm
Location: Poland

Re: Problem with Q3 Shaders lightning

Post by nCore »

OK, so I found that if I change material.Lightning property to true in void CQuake3ShaderSceneNode::render() in CQuake3ShaderSceneNode.cpp and additionally change the blendfunc modulation to EMFN_MODULATE_4X these shaders look pretty much what I want to achieve, but still this is not what I need.

Take a look:
Image

I thought a lot of this stuff yesterday and I have an idea, not sure if this is good but, is there any possibility to turn BSP lightmaps off but leave the dynamic lightning?

EDIT: You guys probably ask me why did you change anything in Irrlicht's source? Because trying to set anything through:

Code: Select all

 
node = smgr->addQuake3SceneNode(meshBuffer, shader);
 
node->setMaterialType(EMT_LIGHTMAP_LIGHTNING);
node->setMaterialFlag(EMF_LIGHTING, true);
 
does not change anything in shader's material :(

Am I doing something wrong? Maybe I should RTFM?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Problem with Q3 Shaders lightning

Post by hendu »

To use only dynamic light, set the type to EMT_SOLID and the modulation/blend to their defaults.
nCore
Posts: 3
Joined: Fri Jul 05, 2013 8:00 pm
Location: Poland

Re: Problem with Q3 Shaders lightning

Post by nCore »

Nope. This is not helping me at all... Everything looks... solid. And really bad. OK, we can close this topic. I've changed my mind. I give up with BSP, and taking another way. Creating whole maps with my custom meshes, and saving them into irrmodels or xml. Thanks anyway :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Problem with Q3 Shaders lightning

Post by hybrid »

Maybe we can keep on searching for a solution if you have some time?! At least in case the q3 shaders don't adhere to the matrial settings properly, we should check if we can do better. Can you tell me what is wrong in your render pic after altering the shader scene node?
Post Reply