 |
 |
GoldenEye 007 Nintendo 64 Community, GoldenEye X, Nintendo 64 Games Discussion GoldenEye Cheats, GoldenEye X Codes, Tips, Help, Nintendo 64 Gaming Community
|
 |
 |
 |
 |
|
 |
 |
 |
 |
 |
TimEh Agent

Joined: 08 May 2009 Posts: 187 Location: oakville. ONT, Canada  |
Posted: Sat May 09, 2009 9:13 am Post subject: Light Editor |
 |
|
So after numerous hours painting vertex colours one at a time i came to the conclusion im gonna write a light editor. Now this is how i figure it would work. Every vertex is set to black at the start. When a light is placed, it will check the lights visible vertices and based on its magnitude and distance, add that number to the vertex. Repeat that process for every light. I know this would be far from perfect, but at least all you would have to do is tweek the lights a bit after, and not do it from scratch. This wont slice the polys to make the correct angles, so one would still have to steup his poly placement correctly to get the proper effect.
I figured loading/saving the polys from RoomVertices.bin/RoomIndices.bin would be the best method. so ive figure out the RoomVertices.bin format:
XX XX YY YY ZZ ZZ 00 00 UU UU VV VV RR GG BB AA
|.....vertex coords..|.N/A .|.Tex U/V ? .|....Colour.....|
i think thats right. well the coords and colours are, and thats all ill be modifying from there. The RoomIndices.bin is given me some troubles though.
I was wondering if any of you could explain the vertex index file format?
Also, i think a very usefull feature to be added to the GEeditor would be the copying/pasteing of vertex colors from a poly, and also multiple selection of polys to colour. I know this would produce unwanted effects if only one or two vetices of a poly were coloured depending on the orientation. But would greatly speed up 3vertex poly colouring.
sample of my new multi map with lighting |
|
|
|
|
|
 |
 |
 |
 |
 |
bmw Hacker


Joined: 04 Jan 2006 Posts: 1367 Location: Michigan  |
Posted: Sat May 09, 2009 9:56 am Post subject: |
 |
|
Great idea - in theory, something like that should work. In fact, it sound simple enough to me that its something subdrag may be able to implement into the editor, like you said, simply a calculation of each vertex based on distance from the light source. So I guess the way I would envision it working is you right click on any tri, select an option for INSERT LIGHT HERE, then a box pops up asking for simply a light intensity value. The light intensity value would be the number of units away from the light you want to be impacted. So if you put in a value of 300, your light source will have a RGB value of 255, 255, 255, and all points 299 units away would have a value of 1, 1, 1, and everything in between would vary accordingly. Granted, this still has its share of problems and would require a lot of manual tweaking but it could save somebody a lot of time lighting a room.
btw - did you know there's already a way to lighten or darken an entire room? Not sure if it was ever published in the help file or if its still a beta feature, but if I remember correctly you can use M or CTRL-M to lighten or darken an entire room if in room positions mode and you disable ability to move rooms. |
|
|
|
|
|
 |
 |
 |
 |
 |
Dragonsbrethren Hacker


Joined: 23 Mar 2007 Posts: 3058
 |
Posted: Sat May 09, 2009 10:14 am Post subject: |
 |
|
This sounds like a great idea. I would suggest adding a way to create environmental lighting for outdoor rooms, and a way to set the ambient lighting for a room. |
|
|
|
|
|
 |
 |
 |
 |
 |
TimEh Agent

Joined: 08 May 2009 Posts: 187 Location: oakville. ONT, Canada  |
Posted: Sat May 09, 2009 11:09 am Post subject: |
 |
|
ya bmw thats pretty much how i saw this working. I think it would be alot simpler for Subdrag to implement into the editor than me writing a seperate app, since the renderer is already working with the GE files and he would just have to focus on the lighting part of it. This is how I would envision it being in the editor:
separate section from objects/clip/portal/room/ect... its own edit light mode
rightclick would bring the menu: add(default insertion would be the tri clicked), cut/copy/paste, edit(dialog for radius and origin) and a Calculate lighting.. (pretty much what u were thinkin bmw )
Calculate light would traceline visual vertices from the lightsource and add the amount to it based on the radius value then save it to the RoomVertices.bin/RoomIndices.bin
lights would be cubes like presets
lights would have to be saved seperatly from the GE files( since the light origin and radius itself is never imported in the game)
if ambiant lightin is to be supported as Dragonsbrethren said than the edit light mode would also have to be able to select rooms and have an edit box to input the ambiant value. Calculatin with the ambiance shouldnt be hard. Instead of every vertex being set to black before light calculation, each vertex in there own rooms is set to their ambiant value. These ambient values also stored in the light save file
theres alot more things that could be implented but i think that should be it at its basic level. We'll see what SubDrag thinks about this. If hes up for the task, sweet. If not i hope he can point me in the right direction with the Indices format and ill get this started. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6178
 |
Posted: Sat May 09, 2009 7:57 pm Post subject: |
 |
|
Hmm, interesting ideas. Certainly would have interesting results.
Is lighting really that simple though? I guess it could be. Just simply do the calculation you said:
Ie: Pick point, set as light source X units.
Then do calculation to all triangle points, and if it is in X units, set lighting to X, X?
What do I do about coloring though? Is it always lighted by greys (ie X, X, X, X) for R,G,B?
I'd be up for adding this if you can give me the algorithm. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6178
 |
Posted: Sun May 10, 2009 2:07 pm Post subject: |
 |
|
I gave it a shot. It uses a circle of radius distance typed in to get range. The other values go from 0 to 255, 255 is white, 0 is black. Haven't tested it too deeply, but give it a shot. In room positions mode (BACK UP YOUR WORK FIRST), right click on a wall, and click set light source or whatever. Then type and hit ok. Whereever you clicked is center point of circle.
http://www.battlefieldforever.com/hackers/priv/subdrag/runwaysetupeditor.exe (put in same dir as editor and run instead) |
|
|
|
|
|
 |
 |
 |
 |
 |
Dragonsbrethren Hacker


Joined: 23 Mar 2007 Posts: 3058
 |
Posted: Sun May 10, 2009 3:01 pm Post subject: |
 |
|
Seems to be working great, I haven't tried exporting my changes yet though. I'll probably whip up a simple test map for this tomorrow if I get a chance.
Some suggestions would be to allow a color to be assigned to the light, and allowing lights to add to each other. Right now if you do two lights very close to each other the black part of the second light's radius will overwrite what was the bright center of the first light; ideally they would blend together. I suppose walls casting shadows is completely out of the question? |
|
|
|
|
|
 |
 |
 |
 |
 |
monkeyface Moderator


Joined: 05 Apr 2008 Posts: 275
 |
Posted: Sun May 10, 2009 3:40 pm Post subject: |
 |
|
Works like a charm! Still wish I could do it without the right-clicks, so that you could paint the map, almost. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6178
 |
Posted: Sun May 10, 2009 4:13 pm Post subject: |
 |
|
If you can find some algorithm to do that fanciness, i'd be happy to try. I'd still like to do the brush thing eventually, but this is easier for now. Not sure how colored ones would work. |
|
|
|
|
|
 |
 |
 |
 |
 |
Dragonsbrethren Hacker


Joined: 23 Mar 2007 Posts: 3058
 |
Posted: Mon May 11, 2009 1:18 am Post subject: |
 |
|
For colored lighting, it would work the same way as now except you could set 0-255 for each color. This would be just like the white-to-black default, except a smooth gradient would need to be made for odd combinations (like blue turning to yellow, the mid shades would be green). I would imagine any color gradient drawing code could be used for this.
Getting the lights to add to the existing vertex colors is pretty important. Originally I was thinking you could just add the exiting vertex color and the new one together. That might not be the best way to go about it, but it's better than just overwriting the existing color. For an example, load Facility, go the the hallway with green walls, and add a light. The green shading will be lost in any place that the light effects, which isn't desirable. The light should just compliment the existing color in those cases, lighten the green, but don't replace it with gray. I suppose for now, for custom maps, we could just do any shading after adding all of our lights. |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6178
 |
Posted: Mon May 11, 2009 5:09 am Post subject: |
 |
|
Instead of one flat color, I will add the 3 R,G,B start/end colors hopefully tonight. I don't know how to merge lighting, because on one hand, we want to replace it all, on the other, sometimes want to merge, I don't see a good way to do it. If you give me an algorithm, I can try, and putt a toggle or something to overwrite, or merge. |
|
|
|
|
|
 |
 |
 |
 |
 |
TimEh Agent

Joined: 08 May 2009 Posts: 187 Location: oakville. ONT, Canada  |
Posted: Mon May 11, 2009 11:49 am Post subject: |
 |
|
ahhhhh!!!! WTF. Ok so i just wrote for about an hour or so explaining the way to do the lights( the culling of vertices not the colour part) and i went to preview the message and i must have timed out. I logged in and all i typed was gone. so imma sum it up cuz i aint retyping all that again.
1. SubDrag, light mode works nice. made a quick map to see how it looked in game.
2. Imma find some source code for some old vertex lit games and see how they do lighting with colour
3. I have the vertex culling process all thought up. it was my Bday weekend and i got pretty messed up the past 2 days so when this brain stops pounding ill work out the process into an actual equation.
inno, there was probably more stuff im missing from the original. imma go get some much needed sleep |
|
|
|
|
|
 |
 |
 |
 |
 |
SubDrag Administrator

Joined: 16 Aug 2006 Posts: 6178
 |
Posted: Mon May 11, 2009 2:41 pm Post subject: |
 |
|
It's now split by color, if you want to regrab same beta. |
|
|
|
|
|
 |
 |
 |
 |
 |
radorn 007


Joined: 23 Sep 2007 Posts: 1424
 |
Posted: Mon May 11, 2009 5:30 pm Post subject: |
 |
|
that looks really nice! |
|
|
|
|
|
 |
 |
 |
 |
 |
Wreck Administrator


Joined: 14 Dec 2005 Posts: 7254 Location: Ontario, Canada  |
Posted: Tue May 12, 2009 1:24 am Post subject: |
 |
|
Lighting is one of the few factors left in getting custom maps looking official. I'm glad to see some progress is being made in this department.
By the way, are you creating those maps in Hammer or another modelling program, TimEh? _________________
YOUTUBE | TWITTER/X | FACEBOOK | VAULT | MOD DB | RHDN |
|
|
|
|
|
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
 |