Game Development Community

Lighting with QuArk?

by Jason Jabaut · in Artist Corner · 02/28/2002 (10:01 am) · 16 replies

Just wondering if I am in the only one that can't get lighting to work in the QuArk viewport. I tried the software rendered and OpenGL viewports...I can add something like a red light and export it to torque and it will work great, but the light doesn't light anything while I'm viewing it in QuArk. I tried making a Halflife map and added red lights and I could see my map lit up all red....so it seems to be just a torque thing. If I'm the only one getting this does anyone know what I'm going wrong? Thanks.

#1
09/13/2002 (1:25 pm)
This doesn't look like it works... anyone know anything?

Quark probably needs to be made aware of the Torque lights... I'll look into it...

**A BIT LATER ON***

EDIT: Indeed... Quark isn't abstracted very well in this case... it looks for a 'light' (which is a radius)and a '_color' (RGB 0.0-1.0) field in the entity... if it finds these the light shows up...

*IMPORTANT* By setting the '_color' entry 'typ' in the light:form structure to "LN" you get a nice color chooser to pick your light color with and don't have to specify RGB values(a method that usually results in quite bold color schemes)

Add these to the Quark:Torque light entities and patch up map2dif so that it reads '_color'*255 to 'color' and 'light' to 'falloff1'?

Here are the changes for the omni case... these need to be applied to each light type...

light_omni:e =
        {
          origin = "0 0 0"
          ;desc = "Omni Light"
          color = "255 255 255"
          alarm_type = "0"
          falloff1 = "10"
          falloff2 = "100"
          light = "300"
          _color = "1.0 1.0 1.0"
        }
  light_omni:form =
    {
      _color: =
      {
        txt = "&"
        hint = "Color (R G B)"
	typ="LN"
      }

      color: =
      {
        txt = "&"
        hint = "Color (R G B)"
      }
      alarm_type: =
      {
        txt = "&"
        hint = "Alarm Type"
        typ = "C"
        items = "Normal only"[[60c2167e67da5]]D"Alarm only"[[60c2167e67da5]]D"Both Alarm and Normal"
        values = "0"[[60c2167e67da5]]D"1"[[60c2167e67da5]]D"2"
      }
      falloff1: =
      {
        txt = "&"
        hint = "Falloff1"
      }
      falloff2: =
      {
        txt = "&"
        hint = "Falloff2"
      }
    }

-J
#2
09/13/2002 (3:23 pm)
Could you explain how you get to the files or panel for the lights so that the modification could be made? I am just not that up to speed on quark. I looked through everything but couldn't figure it out.

Thanks
#3
09/13/2002 (3:32 pm)
The Torque addon file DataTorque.qrk is where this is stored...

Unless you patch up Map2Dif to read these values you will not see the proper lighting in Torque... though you could feasibly copy the _color->color and light->falloff1 values manually while in quark...

-J
#4
09/13/2002 (4:35 pm)
If I understand you correctly, the lights in QuArK are decimal. The lights in Torque are decimal too, so I don't understand why they won't convert properly.

Sorry, Joshua... you're boldly going where I've never gone before. lol
#5
09/13/2002 (8:43 pm)
I missed Jason's post in February (I look mainly in the mapping section)--good catch Joshua!

Here's a link to a modified map2dif_DEBUG (from the HEAD version) and a modified DataTorque.qrk.

Put the map2dif_DEBUG.exe under the /tmpQuArK folder and DataTorque.qrk under the quark63c/addons/torque folder. BACK UP YOUR ORIGINALS FIRST.

The changes I've made should allow map2dif to work for either QuArK or Hammer/WC users. Test it out and if it works good for everyone I'll send in a patch. Let me know if you need the map2dif for other releases (i.e. R.1.1.2).

holodeck.st.usm.edu/vrcomputing/vrc_t/tools/updates/quark_updates.zip

Again, great ideas!
#6
09/13/2002 (9:23 pm)
Are you using the portals like you are suppose to when it comes to getting lights working? If you do not use portals it will cause the lights to either not show up at all or just barly.
#7
09/13/2002 (10:37 pm)
Desmond,

Check out this while you're at it :)

www.garagegames.com/projectmanager/issue.php?qis=103

I run into this all the time unless I up the winding vertices... a simple fix is just to up the vertex count allowed on a winding...

-J
#8
09/14/2002 (6:42 am)
I really didn't notice a change in the maps. Are we supposed to see the lights in action or did I miss somthing?
Thanks
Matt
#9
09/14/2002 (10:13 am)
@Nathan: I don't really know what you mean. I tested the lights with and without portals --->no problem. You don't need portals to have the lights show up...you can put lights on the outside of your interiors if you want: doesn't matter. However, you can change whether ambient light from the world passes through the portal (or not); this light is blended with any interior lights when the scene is relighted and the combined lightmaps are stored in the ml file.

@Joshua: I'll give it a look see. Could you send me the dif (and qkm) that causes the reproducible error you found?

@Matthew: Yes, the lighting shows up in the QuArK OGL window--very nice. I remember this from my Half-Life mapping but hadn't given it any thought for Torque mapping. I'm glad Jason and Joshua brought this to the forefront. I'll send you screenies if you want; did you put the DataTorque.qrk in the correct folder? As Joshua said, QuArK is looking for specific names (i.e. "light" and "_color") to represent light values in the OGL window.

Change the lighting in the sample map I included and tell me what you see; make them bold blue or red etc.
#10
09/14/2002 (12:02 pm)
Make sure you have "lights" turned on OpenGL... it's Configuration-->General--OpenGL-->Lights

If you have it on 'Full Bright', it won't show the lights.

This is great... thanks Joshua and Desmond. Very nicely timed for what I need to do next. :-)

Edit:
Desmond, are the light_emitter_point and light_emitter_spot working, or now outdated? They have no _color option.
Also, does anyone's lights show up(roughly) the same in OGL window as in Torque?
#11
09/14/2002 (1:17 pm)
Yes Eric, my lights show up about the same (not accounting for the additional ambient light of course).

As to the point_ and spot_emitters, I've not been able to figure out what they do --I was thinking of taking them out of the QuArK menus until someone does figure it out.
#12
09/14/2002 (1:29 pm)
My omni light appears to be about the same, but the pulse ones don't show up in QuArK and do in Torque. Same with a spotlight I tried.
#13
09/14/2002 (2:19 pm)
Oh yeah, what I did was only translate the color1 because QuArK only knows about one color/radius. The lights with multiple colors will only show the first color (for now). Problem there is I would have to get into the QuArK code to let it recognize additional lights. That could happen some time....
#14
09/14/2002 (8:23 pm)
Ya I got it going. I had to add new lights then the _color took effect. Thats great!
Thanks
Matt
#15
01/13/2004 (9:42 pm)
How do you get Quark to display lighting in the openGL window - close to what would be seen in-game?
Not using radiosity - so I can use the flickering lights, etc - but when building and looking in the openGL view - its pretty dark and I have to change the light level to 1000 to see any light affects - ie - light is set to 100 - for the engine - and shines VERY bright - but in the openGL Viewer - it shines bright - but when putting it back to the correct value -ie 100 - I can't see any light - its just very dark - as if I turned the brightness way down. Any plans on adding this or fixing it in the openGL Window to display more real time lighting to what would be seen in the engine?
#16
01/22/2004 (12:35 pm)
This site dead?