Hi, I finally decided to play a bit with IrrCg, so I complied it and started editing the first example program -Basic lighting. After getting familliar with the code and watching the results I have some questions about it: (hopefully I won`t get beaten for that
)
1) Looks like the light position given is in object`s local space. Here`s what I did to make it work right for my test:
Code: Select all
// in PerPixelLightingCallBack
lightPosition = cgGetNamedParameter(Pixel, "lightPosition");
vector3df p = vector3df(-200,0,0); // my object`s position
vector3df v = node4->getPosition(); // my light node position (flyCircle animated)
vector3df r = v-p; // some result position
services->setParameter3f(lightPosition, r.X, r.Y, r.Z);
but this is only for one node. How can I make it work for all nodes where applied, since this is some lame way doing this?
2) The code applies per pixel lighting material for one light. Can I make my node be affected by many lights same time- like a level node lit by many lights?
3) Can I adjust the light range and attenuation? I want to get sth like this:
http://www.3ddrome.com/articles/cgshaders.php (poor me- recently spamming some shader links ^^)- the picture at the bottom. My "scene" is the cube left from the elephant (backface culling disabled), but scaled 20x and the light is moving in circle in it, which gives me weird results when light passes by the origin of the cube (because it`s in it all the time and it lights the positive x side only).
4) Calling "setMaterialTexture()" gets totally ignored. Can I have texture and lighting same time? Multitexturing maybe?
Thanks, Nadro for creating this nice binding. I may try implementing it in my app if I manage to use it and am pleased with my test results.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."