.
Results 1 to 8 of 8

Thread: Question on lighting buildings

  1. #1
    Join Date
    Jul 2011
    Location
    United States of America, PA
    Posts
    20
     

    Default Question on lighting buildings

    As a newbie to re-skinning, I've managed to create a few buildings and signs, but now I'm a little lost on how the night lighting is done. I looked through several posts, but nothing seems to address the problem I'm having unless I overlooked it or didn't use the right keywords. How do you light buildings? Any help would be appreciated greatly! Also, this may sound like a "Duh" question, but if I re-skin a building that I would like to upload, but I need permission from the author, can I do so through the forums or should I use the blog? I was looking to see if I could find an e-mail, but again, I may not be looking in the right place. I told you I was a newbie!
    OK, scratch that question about contact info...you aren't going to believe this, but I was actually looking at the e-mail and thinking "that's just the e-mail, I need the contact info!" Oh well, I haven't done that in a while! I'm feeling pretty silly right now! :P Thanks for the info on the night mode but since it involves meshes, I think I'll leave it alone for now.
    Last edited by Spirit0f64; May 29th, 2014 at 07:07 AM.

  2. #2
    Join Date
    Nov 2006
    Location
    United States of America, Tennessee, Lewisburg
    Posts
    5,475
     

    Default

    If you mean nightmode its done with special textures for the window glass. I use two separate textures but you need the original mesh. I not sure it can be added after re-skinning. One has a transparency factor the other a "glow-in-the-dark" (specular?) factor. The window glass is exported in a separate image file named nightmode.im and goes into a sub-folder also named nightmode. This is separate from the window glass used during the day. That should stay with the rest of the items mesh. Both nightmode textures are placed in the sub-folder along with the texture text file that cites them both. This is then listed in the config files mesh-table.

    The amount of transparency, the color of the light, and the amount of "glow" are variable by most paint programs.

    For starters I'd suggest you look at what's in a folder for an item that has nightmode.

    Ben
    Trestle Man

  3. #3
    Join Date
    Nov 2006
    Location
    Newcastle NSW Australia
    Posts
    6,521
     

    Default

    Nightmode is a separate mesh to whatever is displayed in the day time. You can find out the name of that mesh and where it is by looking at the mesh-table part of the config - it's usually fairly obvious. Look for the word 'night' in there somewhere.

    This mesh doesn't need to be in a separate folder to the main mesh, in fact for efficiency reasons, it is often in the same folder so it can share the same texture images as the daytime mesh. The nightmode mesh can take its texture from selected parts (e.g. the windows) of exactly the same image used on the daytime model. That's because the textures on nightmode meshes don't necessarily need any special treatment, the game simply keeps them bright when everything else goes dark at night.

    You can open and view the nightmode mesh with PEV Mesh Viewer and use it's "Locate Texture" feature to see the name of the texture/s it uses. Once you know that, you can decide whether it is part of your reskin or not.

  4. #4
    Join Date
    Nov 2006
    Location
    United States of America, Tennessee, Lewisburg
    Posts
    5,475
     

    Default

    Well that shows what I know (or don't know as the case may be, lol).

    Ben
    Trestle Man

  5. #5
    Join Date
    Oct 2009
    Location
    United States of America, Floatin' Along the Delaware River
    Posts
    7,379
    Blog Entries
    3
     

    Default

    Both answers are right. It's best to have access to the original mesh, but you can get away with not having it, if needed, although that will add to the game's overhead. Make sure your config.txt file has the tag "nightmode" set to either "home" or, to have the nightmode on all night, "lamp".

    To add nightmode to an existing mesh, take a look at the Chinese Restaurant or Liberty Place under my kuid to see how it's done, especially the config.txt entries. In these cases, I did not have access to the original mesh, but I was able to add nightmode by duplicating the mesh and its textures in a subfolder, and altering (essentially, "reskinning") the night mesh. Try Gimp; more on that in a sec. The result of this method is that the night mesh and all of its own textures gets overlaid on top of the normal/default/daytime mesh. You need to put the night mesh in its own folder, though, since the texture names will be the same.

    To add nightmode to your own mesh, you start by making a night texture. In the case of my recently-uploaded McMansions, I took a snippet of a window, a door, and a few other bits, putting them into a single, small texture (I think I got it down to 128x256 or something like that). Then I darkened them in Irfanview and went into Gimp (again, more in a sec, lol!) In this case, since I had access to the mesh, I simply made a few planes, sized to the size of the windows, but pulled out a bit so they wouldn't overlap with the original mesh, which will cause flicker, especially far away. I mapped them to the appropriate part of my night texture, then copied each mapped plane everywhere I wanted a window, resizing when necessary for the bigger windows. Once I had all my night bits, I deleted the main mesh and any materials it used, so I was left with a single mesh of about 40 polys' worth of windows and the one ngiht material. This mesh gets overlaid on top of the normal/default/day mesh, providing a night effect. Using this method, you do not need to have the night mesh in a separate subfolder if you don't want to, as long as your texture file has a different name than any of the day textures being used, although I prefer subfolders.

    As far as making a nice night effect, I use Irfanview to darken any textures. A setting of -180 in the brightness section seems to work well and Iview supports batching. I then load the textures to which I want to apply night effects in Gimp. The important function is under Filters, and is called Light and Effects or something like that. You pick a color, and a type of light, point or directional - both are useful, and you can have more than one light source. Set the intensity low, to around .30 or so for most subtle lighting effects. There is another tab with items such as "glow", "shininess" and other effects that can be applied too - you just have to play with the settings til you get something that looks right.

    You can control what part of your night texture gets light by selecting part of it with one of the select tools (box, circle, lasso) before you go into the Lighting and Effects filter. You can even run subsequent passes, using the same filter settings, on different parts of the texture to make realistic-looking window lighting, for instance.
    Eat More Popsicles.

  6. #6
    Join Date
    Nov 2006
    Location
    United States of America, MN, Minneapolis
    Posts
    285
     

    Default

    I am a bit lazy I use alpha channels to cut out the windows in main texuture. make transparent window glass then insert a cube behind it with a texture setting that glows in the dark. Building lights up at night with no need of nightmode Set specular to 0 and that texture glows in the dark
    Last edited by HSSRAIL; June 5th, 2018 at 08:42 PM.

  7. #7
    Join Date
    Nov 2006
    Location
    United States of America, CALIFORNIA, LOS ANGELES
    Posts
    3,995
     

    Default

    Quote Originally Posted by HSSRAIL View Post
    I am a bit lazy I use alpha channels to cut out the windows in main texuture. make transparent window glass then insert a cube behind it with a texture setting that glows in the dark. Building lights up at night with no need of nightmode
    That doesn't sound lazy to me, it seems like a really clever way to do it. Do you have an asset using this method on the DLS?

    Mick

  8. #8
    Join Date
    Oct 2009
    Location
    United States of America, Floatin' Along the Delaware River
    Posts
    7,379
    Blog Entries
    3
     

    Default

    Quote Originally Posted by Mick_Berg View Post
    That doesn't sound lazy to me, it seems like a really clever way to do it. Do you have an asset using this method on the DLS?

    Mick
    It's clever, but the immediate problem I see is, unless the windows are fully alphaed out ("alpha masked"), then performance problems can arise. Alpha-blending is inherently inefficient due to the need for alpha sorting.

    http://online.ts2009.com/mediaWiki/i.../Alpha_sorting

    I only recently learned of a texture tag that can force alpha masking, alphahint=masked. Unfortunately, it's very easy to leave even a single pixel of gray in an alpha mask, and thus be stuck with an alpha-blended material.
    Eat More Popsicles.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •