Creating colored lights with RGB emission

Come here for help & support.
Post Reply
3 posts • Page 1 of 1
FVogt
Posts: 2
Joined: Tue Nov 21, 2017 2:35 am

Creating colored lights with RGB emission

Post by FVogt » Tue Nov 21, 2017 3:01 am

Hello,
First time poster here.
Since a few weeks I am trying to write a Unity 3D to Indigo exporter for my company's architecture software.
I already got a basic mesh and material export working and am now working on exporting lights.

The exporter generates .igmesh files, texture files and the .igs project file from scratch from a C# script.
This means I have to convert from Unity's values to sensible values for use in Indigo.

The problem I now have is exporting lights correctly or at least tolerably.
We have 2 basic kinds of lights: Ceiling lights and dim LED lights.
As a test I exported both as 1cm spheres (easitest in the .igs project file) and gave them a hardcoded phong material with a base_emission of type blackbody, temperature of 7000 K and a gain of 1. This works reasonably well for the ceiling lights.

To export colored LEDs I am now trying to set the base_emission to RGB with the Unity color values. But this simply does not produce any light. Even in a room without any other light source the sphere neither shows up, nor does it emit any visible light. As soon as I switch back to blackbody via the Indigo interface they begin emitting light.

This is the lightsource XML generated by my exporter:

Code: Select all

        <material>
		<name>light_material_0</name>
		<phong>
			<exponent>
				<constant>1000</constant>
			</exponent>
			<diffuse_albedo>
				<constant>
					<rgb>
						<rgb>1 1 1</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</diffuse_albedo>
			<layer>0</layer>
			<base_emission>
				<constant>
					<rgb>
						<rgb>1 1 1</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</base_emission>
		</phong>
	</material>
	<sphere>
		<center>0 1.442432E-07 2.42</center>
		<radius>0.01</radius>
		<material_name>light_material_0</material_name>
	</sphere>
I really dont know why it does not work. Even assigning RGB base_emission in Indigo does nothing but completely eliminate the light source. Even adding gain values (1-1000) to the RGB base_emission does nothing.

One workaround I am considering would be to create colored glass materials and simply put them around the light emitting sphere, but this seems overly complicated.

Does anyone know what I am doing wrong?

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Creating colored lights with RGB emission

Post by OnoSendai » Tue Nov 21, 2017 3:06 am

Your emission values may just be too low.
Try using very large numbers (1e10, 1e15 etc..)

FVogt
Posts: 2
Joined: Tue Nov 21, 2017 2:35 am

Re: Creating colored lights with RGB emission

Post by FVogt » Tue Nov 21, 2017 7:09 pm

Changing the RGB values to ~255,000,000 did the trick, thank you!

Post Reply
3 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 18 guests