Lighting woes

Started by
4 comments, last by Ataru 19 years, 12 months ago
Hmm, I can''t seem to get lighting working. I have a .x file, I load and use lighting with, and it works fine. I have my own geometry, and it doesn''t even when I render them together. So, in the same scene, I can add a light, and the .x file I load has shading etc... everything else does not. My textures are loaded the same way, render states etc... If I turn off all lights in the scene, I still see the geometry, the .x object turns black. What on earth can cause such a thing? My diffuse is set to black I my FVF has normals, and the normals are correct and normalized My geometry also has a Diffuse component, but I set my diffuse to 0x00000000; My material is currently all 0''s except for, ambient and diffuse (all 0.8, but tested with all 0''s as well.) Simply, no matter what I do, the geometry does not appear lit. I think I''ve checked everything, I''m getting a headache.
Advertisement
Remove the diffuse component from your geomettry. Normals and lights are there to generate the diffuse and specular components.

I like pie.
[sub]My spoon is too big.[/sub]
But I use diffuse for transparancy. How else can you set the transparency of an object?

I don''t mind turning the diffuse off when not using transparaency, but if I have it, changing it should affect the model. If I change the diffuse, the objects don''t change, as if the global diffuse is always white.
You can set the alpha value in the material. If you''re using textures, you can set it in the texel values too.

I like pie.
[sub]My spoon is too big.[/sub]
are you using enough vertices in your geometry, xfiles can easily have 100s of vertices and since light is per vertex u need alot of them, a large panel should typically be 64x64 triangles.

regards,

ace
Yes, my objects are quite complex. Actually I noticed that at startup my geometry is black with all lights off, then suddenly pops to white. Somewhere, deep in my engine, I must be doing something bad. I''ll try and figure it out.

This topic is closed to new replies.

Advertisement