Author Topic: EmissiveColor command  (Read 3326 times)

Offline YankeesPwnMets

  • Head Admin
  • Dispatcher
  • ******
  • Posts: 683
  • Gender: Male
  • Lexington Av Express
    • View Profile
EmissiveColor command
« on: January 12, 2014, 03:17:27 pm »
I've been trying to learn the basics of object developing for openBVE this past weekend, so I decided to take a look at the R160 exterior objects from the openBVE Connect site. Most of the commands I had a basic understanding of, but the one command that stuck out to me was this:
Code: [Select]
EmissiveColor 100, 100, 100I never saw that command before, so I decided to take reference back to michelle's old openBVE Developer Documentation, which I had been reading to try and learn object building. It described EmissiveColor as such:
The difference between the Color command and the EmissiveColor command is that the Color command is affected by lighting, while the EmissiveColor command is not. Thus, the EmissiveColor command should be used for faces which would emit light themselves, including signals, lamps, windows and the like. The actual color contribution to the faces will be the sum of the light-affected color data and the static emissive color data.
This command was placed where the roof was being built. Only one side of the roof had this command, the other didn't. Interesting, but, as far as I'm concerned, roofs don't emit light. I loaded up the car in ObjectViewer and sure enough, the train came out looking just fine:

However, since the EmissiveColor command was used to emit light, I was pretty sure that I would be able to see the effects of this command by setting ObjectViewer to night time. Sure enough, this was what came out:

I set ObjectViwer back to daytime and got rid of the command to see what would happen. One side of the roof came out to be much darker than the other.

At first, I just thought that different parts of the roof were using different textures. Perhaps one of the textures was darker than the other for whatever reason and the developer was using the command to compensate for that. However, when I checked the object file further, I realized that both parts of the roof were using the same texture: CurveRoof.png. This disproved my theory. I checked the roof portions of the object again to see if I could spot anything that might have affected the lighting of the roof, but I didn't notice anything. As a result, my curiosity overcame me and I came here to ask this question:

If the same textures were being used, than why would one side of the roof be noticeably darker than the other side? Why would only one side of the roof require the EmissiveColor command while the other side didn't?
« Last Edit: January 12, 2014, 04:05:50 pm by YankeesPwnMets »

Offline ipac

  • Head Admin
  • Dispatcher
  • ******
  • Posts: 646
    • View Profile
Re: EmissiveColor command
« Reply #1 on: January 12, 2014, 03:54:28 pm »
It looks like that dev may have flipped the vertices of that specific face.  If you move around the vertices, it should fix the issue, but you will also need to flip the texture.

The entire roof should use the emissive color command, I don't know why some of it would and some would not.  I can think of two reasons though, one could simply be developer laziness/forgetfulness, or they designed the object to only be seen from one side, which was common back in the BVE days with lacking processor power, but I doubt that was the case these days.