I’m trying to make a red box using ofLight, ofMaterial and ofBoxPrimitive. Here’s my
box.setResolution(300, 300, 300);
light.setPosition(ofGetWidth()/2, 0, 100);
and here is my ofApp::draw();
from what I understand, I should have a red box with a strong white spot. But all I get is a white box. If I change the color of the light, the box becomes exactly the same color as the light, always.
What am I doing wrong?
Maybe try calling:
Don’t forget to call ofEnableDepthTest() in either setup or draw
I’m calling ofEnableDepthTest() already, don’t know why I didn’t include it.
Doing those changes did nothing =/
probably you light is too near to the object and what you are seeing is just the specular? try bringing it further away
Tried multiple values always getting similar results
here’s a sample of what I’m seeing
light.setPosition(ofGetWidth()/2, ofGetHeight(), 1000);
mmh, yes, seems a bug in ofMaterial are you using 0.9 or 0.8.4? with the programmable renderer i’m getting the right behaviour:
i’ve just fixed it in master for the fixed pipeline but there’s a discrepancy now between the fixed and programmable renderers in how the light behaves, i’m looking into it.
I’m using 0.9 RC1
Tried to change the renderer but
don’t seem to work anymore, Is there a new way to do it in 0.9?
as i said it’s also fixed in master now and will be in tonight’s nightlies.
Ok, thanks a lot! This was especially helpful because I intended to use the programmable renderer and completely forgot about it…
I’m try to update some OF 0.8.0 projects to 0.9.0 but I’m having problems with the lights and color. When I compile the projects in 0.9 everything is black and white.
Is it possible to get lights and colored objects without using materials?? Because I made this light test using this simple code: `
ofDrawBox(0, 0, 0, 250);
In 0.8.0 I get:
But in 0.9.0 I get:
I’m also having problems when drawing coloured meshes. When enabling the ofLight the mesh turns greyscale coloured.
As I’m trying to update large projects to 0.9.0 which would be the easiest way of solving this issue?
i’m testing this and it’s working for me fine in 0.9.2 with this code:
in both linux and osx, can you test my example and see if that works? also are you doing something else in your test or only drawing the cube? have you positioned the light?