About Store Forum Documentation Contact



Post Reply 
Material Override - ambient light question
Author Message
mystara Offline
Member

Post: #1
Material Override - ambient light question
Material X has AmbRed, AmbGreen, AmbBlue at maximum.

If I assign Material X to a mesh, the mesh is displayed correctly (i.e. illuminated) as shown on the left.
If I create an object and assign the same mesh and Material X to that object, the mesh is not illuminated as shown on the right.


Attached File(s) Image(s)
   
(This post was last modified: 03-29-2013 06:30 PM by mystara.)
03-29-2013 06:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: [Bug?] Material ambient light
If you're overriding Material using MaterialLock in codes (force material for object in World Editor) it will work correctly only if it's compatible with original mesh material.
Original mesh shaders are used for MaterialLock.
Please read comments on MaterialLock
04-02-2013 12:30 PM
Find all posts by this user Quote this message in a reply
mystara Offline
Member

Post: #3
RE: [Bug?] Material ambient light
Nope, not doing anything like that at all.

In fact, I *think* (though I cannot be certain) that this was in the standard editor.
(This post was last modified: 04-07-2013 11:24 AM by mystara.)
04-07-2013 11:23 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: [Bug?] Material ambient light
Could you attach sample data so I can test this manually?
04-07-2013 11:32 AM
Find all posts by this user Quote this message in a reply
mystara Offline
Member

Post: #5
RE: [Bug?] Material ambient light
Sorry, but I'm afraid that I gave up and tried something else instead. I no longer have the world file.

If I come across the problem again, I will try to preserve as much as possible.
04-07-2013 11:38 AM
Find all posts by this user Quote this message in a reply
mystara Offline
Member

Post: #6
RE: [Bug?] Material ambient light
Okay, I've reproduced the problem.
I'm using the editor that I downloaded from esenthel.com, so this isn't using any kind of custom code.

Two models:
GemTexture.mesh is a model with the material Light.mtrl already applied.
GemNoTexture.mesh is the same model with no material applied.

Both of these models are placed in the world editor. Ambient light and "sun" are disabled.

The object that uses "GemNoTexture.mesh" has the material overridden to use Light.mtrl.

As far as I can tell, this should produce two identical objects. However, as, you can see below, the object that already has the material applied (GemTexture.mesh) is correctly displayed and the other model (GemNoTexture) does not. In particular, the overriden material does not use the correct ambient R, G, B values.

World file, material file and model files provided for reproducibility.


Attached File(s) Image(s)
       

.zip  files.zip (Size: 30.28 KB / Downloads: 3)
04-18-2013 08:08 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: [Bug?] Material ambient light
Hello,

This is as I've wrote in the previous post http://www.esenthel.com/community/showth...6#pid38496

Original mesh material has zero ambient (ambient shader disabled), but new material has ambient (ambient shader exists), therefore materials are not compatible, and results will not exactly be the same.
04-20-2013 12:10 PM
Find all posts by this user Quote this message in a reply
mystara Offline
Member

Post: #8
RE: Material Override - ambient light question
Okay.
04-20-2013 01:09 PM
Find all posts by this user Quote this message in a reply
Post Reply