SinglePass technique not supporting Ambient and Spot light? [fixed]

I was modifying my material definition for my bloom filter and I got a crash saying:

[java]java.lang.UnsupportedOperationException: Unknown type of light: Ambient[/java]

I’m wondering if that’s by design. Is it an omission or those two types of light are not supported, or are they not supported yet? If they are not and won’t be, would it be possible to have something like:

[java]

[…]

case Spot:

case Ambient:

throw new UnsupportedOperationException("Unsupported type of light: " + l.getType());

break;

default:

throw new UnsupportedOperationException("Unknown type of light: " + l.getType());

[…]

[/java]

or if they will eventually, maybe say "Not supported yet: "

It would help understand why there’s a crash. :slight_smile:

uh…where is that code you’re quoting? Ambient lights are supported.



And…why would you have to modify the material definition for the bloom filter?

It’s from Materials.java



[java]java.lang.UnsupportedOperationException: Unknown type of light: Ambient

at com.jme3.material.Material.updateLightListUniforms(Material.java:592)

at com.jme3.material.Material.render(Material.java:856)

[…]

[/java]



As for the second question, since the BloomFilter wiki you linked mentions SinglePass but Lighting.j3md doesn’t have it, I copied it and added that to it then renamed it. That’s how I got the error.



BTW, I’m getting some results, but don’t like the look of it yet. :wink:

Should be fixed now

2 Likes

Thanks for the fix.