Page 2 of 13

Posted: Sat Nov 03, 2007 11:33 pm
by Halifax
@christian: Yes, yes, in Resistance they had lightmapped areas where you could use flashlights.

Here is the link, mind you it is lengthy, and very in-depth on the lighting in R:FOM

http://www.cybergooch.com/tutorials/pag ... _rfom1.htm

Posted: Sun Nov 04, 2007 6:49 pm
by sio2
My Motion Blur demo would be a great candidate for a flashlight demo. Not only does it use a lightmapped Quake3 level, but it uses an HLSL shader instead of the standard lightmap material (the level is dark and I wanted more control of lighting).

I'll try a test, removing the motion blur and rendering a spotlight from the camera (computed in the pixel shader for per-pixel lighting).

Posted: Mon Nov 05, 2007 12:18 am
by sio2
<snip>

Posted: Mon Nov 05, 2007 4:46 am
by Virion
Looks nice, sio2. :D

Posted: Mon Nov 05, 2007 4:47 am
by BlindSide
Cool, are you using projective textures by any chance? (I think this can be done fixed function too if you are (Not that theres any reason to))

Posted: Mon Nov 05, 2007 7:44 am
by hybrid
BlindSide wrote:Cool, are you using projective textures by any chance? (I think this can be done fixed function too if you are (Not that theres any reason to))
I'd be really careful with this kind of suggestions - at least some people do not really like it. I do, though, and projective textures are pretty simple using the fixed functions pipeline.

Posted: Mon Nov 05, 2007 12:00 pm
by BlindSide
Come to think of it he is probably just using a spotlight lighting model. (As described here.)

Posted: Mon Nov 05, 2007 3:55 pm
by christianclavet
Hi, Thanks for all your suggestions. It's greatly appreciated.

sio2: That exacly the look I'm after when the player is in the pyramids. Some parts will have a light map because it's lit. But this is where the player will find the underdiscovered tunnel.

Developpement is slow right now, because I'm learning how C++ "Classes" work. I Learned Pascal some years ago. And theses OOP model where unknow to me. I used classes in examples for my Event Receiver (that I barely understood) and had only that in my previous demo.

I've look at the IRRWizard code and it's all made with classes. I want to use the same method(more flexible and clean). I have written code to load the IRRScene and apply a standard collision method, and will rewrite it using classes.

I'm not sure if it's possible, but after the game is released, we could put the most useful functions in a .DLL to support IRRlicht for creating games. Kind of a GAME SDK for IRRLicht. If the functions are done in classes, I assume it will be easier. (From what I've read, a well written class work like a "black box" with inputs and outputs)

Hybrid: I've learned from the TRACKER that a camera controller was implemented. Is it implemented in SVN release 1037-1038?
https://sourceforge.net/tracker/index.p ... tid=540679

Posted: Mon Nov 05, 2007 4:57 pm
by hybrid
No, as you can see bitplane has reverted this feature (which he also added before, I just posted the tracker comment). It was also no controller, but just a method exposing a setSpeed interface. A camera controller would use a scene node animator like interface which accepts events and reacts based on time. So it's basically ripping some parts out of the movable cameras and outs it into separate classes. We just have to be sure that the event handling is still working. I guess bitplane will finish this once he has more time again.

Posted: Mon Nov 05, 2007 7:30 pm
by sio2
BlindSide wrote:Come to think of it he is probably just using a spotlight lighting model. (As described here.)
Read my earlier post:
sio2 wrote:I'll try a test, removing the motion blur and rendering a spotlight from the camera (computed in the pixel shader for per-pixel lighting).

Posted: Tue Nov 06, 2007 7:11 am
by BlindSide
So is that a yes or a no? "rendering a spotlight from the camera (computed in the pixel shader for per-pixel lighting)." can be done using a million different methods. If you are suggesting that yes, you are using a spotlight like described in the article then I understand.

Posted: Tue Nov 06, 2007 7:36 pm
by sio2
BlindSide wrote:So is that a yes or a no? "rendering a spotlight from the camera (computed in the pixel shader for per-pixel lighting)." can be done using a million different methods. If you are suggesting that yes, you are using a spotlight like described in the article then I understand.
Why does it matter HOW I'm doing it, FFS. As soon as I give Christian the source and he puts it in SVN you'll see how its done. But since you know a million different methods I'll leave it for you to do instead...

Posted: Tue Nov 06, 2007 8:03 pm
by christianclavet
Sio2: Wow! Thanks!

Is there a way to have both? (Motion blur + Flashlight) :lol:

Hybrid: Ok. Thanks for the info. I'll do the missin feature to the camera then. (crouch, run, walk, tilt on corner, tilt when strafing).

Right now I'm working to put the current code in classes and try to limit the global variables to a mininum.

Here is a newbie C++ question: Can I define an object (class) that could contain the values needed for other classes? (Values like, screen configuration, game states, controller type, etc). This way I could definitively get global variables out of the code. In my level demo I had more than 30 global variables and didn't liked it at all. (Hard to re-use)

Posted: Tue Nov 06, 2007 11:07 pm
by hybrid
Just make a struct GameConfig which contains all the variables. That way you just have to instantiate one of this structs and set all (by default public) attributes. But you have to pass the object around then...

Posted: Wed Nov 07, 2007 4:24 am
by christianclavet
Thanks. I'll try to make it work.

The code given by Vitek(Travis) for adding OCCTREE to the MetaSelector based of the scene graph was well written, so it was easy to put in a class.
I'm planning to incorporate to it adding terrains to the metaselector. So terrains will also have the basic collision. That should be fairly easy. (Not sure I'll use it, but could be useful for other project.)

I'll try to create such a class (putting all the game variable in an object) that will have info about the game itself. It's already to look cleaner. :)