Thanks Johan! I'm really flattered of your response, it still has some work left, i'm thinking of applying a red luminance on the top of the quad columns with the lightmap texture, simulating the light illuminating the top of the columns from the red beacon lights enabled at night.
this is somehow hard, because the only parameters exposed to us from the .eff files that we can manipulate are the <uniform></uniform> parameters,
for example to enable light map you can use this in an xml file, as i do on this model:
- Code: Select all
<effect>
<inherits-from>Effects/model-combined-deferred</inherits-from>
<parameters>
<lightmap-enabled type="int">1</lightmap-enabled>
<texture n="3">
<image>./alhajj_module2.png</image>
</texture>
</parameters>
<object-name>higher_face</object-name>
<object-name>columns</object-name>
</effect>
the "lightmap-enabled" parameter exists as a <uniform></unifrom> in model-combined-deferred.eff at line 323:
- Code: Select all
<uniform>
<name>lightmap_enabled</name>
<type>int</type>
<value>
<use>lightmap-enabled</use>
</value>
</uniform>
as you can see i enabled the lightmap by passing "<lightmap-enabled type="int">1</lightmap-enabled>" under the parameters for effects in the xml (it expects an int value as shown above, "0" or "1", in other words disabled or enabled).
for interpolating the lightmap intensity with the time of day i would have to look at the other uniforms that exists in the "model-combined-deferred.eff", other wise a red luminance at full intensity will appear awkward in the day.
the original instruction written at the wiki states to use "lightmap-factor" as the uniform you would pass into the xml to control intensity, but on the current version of "model-combined-deferred" there aren't any lightmap-factor to use for this purpose, but there are seperate intensity to change color on each of the RGBA elements (assuming A means ambient",
- Code: Select all
<uniform>
<name>lightmap_r_factor</name>
<type>float</type>
<value>
<use>lightmap-factor[0]</use>
</value>
</uniform>
<uniform>
<name>lightmap_r_color</name>
<type>float-vec3</type>
<value>
<use>lightmap-color[0]</use>
</value>
</uniform>
<uniform>
<name>lightmap_g_factor</name>
<type>float</type>
<value>
<use>lightmap-factor[1]</use>
</value>
</uniform>
<uniform>
<name>lightmap_g_color</name>
<type>float-vec3</type>
<value>
<use>lightmap-color[1]</use>
</value>
</uniform>
<uniform>
<name>lightmap_b_factor</name>
<type>float</type>
<value>
<use>lightmap-factor[2]</use>
</value>
</uniform>
<uniform>
<name>lightmap_b_color</name>
<type>float-vec3</type>
<value>
<use>lightmap-color[2]</use>
</value>
</uniform>
<uniform>
<name>lightmap_a_factor</name>
<type>float</type>
<value>
<use>lightmap-factor[3]</use>
</value>
</uniform>
<uniform>
<name>lightmap_a_color</name>
<type>float-vec3</type>
<value>
<use>lightmap-color[3]</use>
</value>
</uniform>
i will have to play with this more, you can also pass a property for a uniform in the xml, for example aircraft has it much easier for them, to enable lights/lightmap on specific section of the plane, you take the boolean property for the actual cockpit light switch, and pass it to to the uniform:
like so:
- Code: Select all
<factor><use>/controls/lighting/panel-norm</use></factor>
but for real time lighting, it would make sense to choose a property that allows for manipulation of intensity between day/night cycle.