EmissiveColor command
+2
Dexter
YankeesPwnMets
6 posters
Page 1 of 1
EmissiveColor command
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:
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?
- Code:
EmissiveColor 100, 100, 100
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: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.
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?
YankeesPwnMets- Posts : 15
Join date : 2014-01-05
Age : 43
Location : New York, NY
Re: EmissiveColor command
I think you find the problem you are describing is to do with the shading. I think it is because Openbve is still heavily reliant on the way that bve works ie 2D as opposed to 3D.
There is a way around it though by putting an extra amount of code in at the end of the vertex command. This will balance the two out.
There is a way around it though by putting an extra amount of code in at the end of the vertex command. This will balance the two out.
Re: EmissiveColor command
Is it using Face or Face2 commands, and what is the sequence for each of the two sides?
If you use a Face2 command with the same vertex sequence on the opposite side of the roof, then the lighting will be darker. To reverse this effect, you reverse the sequence of vertexes in the Face2 command. I suspect the author of this object is unaware of this fact
A simple pair of examples (Add whatever texture you want).
Differing Lighting:
Same Lighting:
Cheers
Chris Lees
http://www.bvecornwall.co.uk
If you use a Face2 command with the same vertex sequence on the opposite side of the roof, then the lighting will be darker. To reverse this effect, you reverse the sequence of vertexes in the Face2 command. I suspect the author of this object is unaware of this fact
A simple pair of examples (Add whatever texture you want).
Differing Lighting:
- Code:
[MeshBuilder]
Vertex 0 , 2.7 , 0
Vertex 3.6 , 2.7 , 0
Vertex 3.6 , 0 , 0
Vertex 0 , 0 , 0
Face2 3,2,1,0
[Texture]
Load texture.png
Coordinates 0, 0, 0
Coordinates 1, 1, 0
Coordinates 2, 1, 1
Coordinates 3, 0, 1
[MeshBuilder]
Vertex 0 , 2.7 , 0
Vertex -3.6 , 2.7 , 0
Vertex -3.6 , 0 , 0
Vertex 0 , 0 , 0
Face2 3,2,1,0
[Texture]
Load texture.png
Coordinates 0, 0, 0
Coordinates 1, 1, 0
Coordinates 2, 1, 1
Coordinates 3, 0, 1
Same Lighting:
- Code:
[MeshBuilder]
Vertex 0 , 2.7 , 0
Vertex 3.6 , 2.7 , 0
Vertex 3.6 , 0 , 0
Vertex 0 , 0 , 0
Face2 3,2,1,0
[Texture]
Load texture.png
Coordinates 0, 0, 0
Coordinates 1, 1, 0
Coordinates 2, 1, 1
Coordinates 3, 0, 1
[MeshBuilder]
Vertex 0 , 2.7 , 0
Vertex -3.6 , 2.7 , 0
Vertex -3.6 , 0 , 0
Vertex 0 , 0 , 0
Face2 0,1,2,3
[Texture]
Load texture.png
Coordinates 0, 0, 0
Coordinates 1, 1, 0
Coordinates 2, 1, 1
Coordinates 3, 0, 1
Cheers
Chris Lees
http://www.bvecornwall.co.uk
Re: EmissiveColor command
Is it the same if it is using the Face command instead of Face2?
YankeesPwnMets- Posts : 15
Join date : 2014-01-05
Age : 43
Location : New York, NY
Re: EmissiveColor command
Never.. .YankeesPwnMets wrote:Is it the same if it is using the Face command instead of Face2?
Face2 can cause Sun Lighting Position Problems. It's Better use Face and invert the Vertex number position
Example
[meshbuilder]
vertex 0,1,-1
vertex 0,0,-1
vertex -1,1,0
vertex -1,0,0
face2 0,1,3,2
[meshbuilder]
vertex 0,1,0
vertex 0,0,0
vertex 1,1,1
vertex 1,0,1
face2 0,1,3,2
As you can see a Face2 command generating trouble with sun light position.
Front lighting is bright
Back lighting is darker.. ALL ON SAME FRONT.
I recommend you always use a Face and invert the position of the vertex on face #,#,#,# in case of the model face doesn't appear
Last edited by Manuel18 on Fri Jan 17, 2014 12:01 am; edited 1 time in total
Manuel18- Posts : 76
Join date : 2012-10-18
Age : 30
Location : Caracas,Venezuela
Re: EmissiveColor command
Maybe this can be of some use http://railsimroutes.net/blog/?m=200906
Northern Line- Posts : 329
Join date : 2011-07-12
Age : 31
Location : London, UK
Similar topics
» Height command in OpenBVE
» New Renderer causes EmissiveColor faces turning dark in routes (Latest 1.7.1 versions)
» Shear Command
» .section command
» BVE4:Pitch command
» New Renderer causes EmissiveColor faces turning dark in routes (Latest 1.7.1 versions)
» Shear Command
» .section command
» BVE4:Pitch command
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum