Max register values

Feb 23, 2012 at 4:50 PM

Hi, do you think you could explain the technical reasons behind this error? I've been playing around with creating a high-detail environment, and as such, created a linked effect with the following: texture/normal/specular/shadow/ambientlight/directionallight. I then went to add a spotlight as a test and got an error on compile that stated that max registers were set to 31 and I had exceeded that. Substituting the spotlight for a point light, it compiled and ran great. Adding 2 point lights, I again exceeded the register limit and earned a compile time error.

Could you explain why that is?

Also, I do not use "Scene" or "World" as I've been using Nine for quite a while before I noticed them and have been getting along fine without. I notice you have a lightmanager in the source code, but trying to load/draw FBX models using the Scene doesn't work. If you finish the scene management/display and put a simple tutorial with models/lights/animation, that would be great!

Thanks again for the software, it works great and we're making good progress with it!

Thanks,

James

Coordinator
Feb 24, 2012 at 2:44 AM
Spotlight needs more registers than pointlights, and normal/specular mapping makes it even worse. My suggestion is when you want to combine normal/specular mapping with multiple light sources, use deferred lighting instead. That technique is independent of the light count.

There is a tutorial in the 1.2 source code on how to create a scene with lights, shadows and even some basic physics. Chances are that you forgot to add some basic lights to illuminate the scene so it may appear competely dark.

Glad to hear you guys are making progress :)