using materials without light? is it possible?
hiya,
i''d like to color my cube green by using materials, but i don''t want lightings enable. how?
also, i want to use textures plus lightings but no materials. Is this possible?
many thanks,
If i''m not wrong, a material is used to specify the color which reflects from the object, when a light hits it, and so I guess that using materials without a defined light source is a no no. Having said that, I don''t know if it''ll work with ambient light - key point here? Experiment and see what works....
With regards to your other question, Direct3D will apply a default material (again, if i remeber correctly) to an object, and so in effect you always have a material present (i think it''s a basic matte white material), even tho you don''t specify a material explicitly.
If you want a green cube, but find that the material + no light thing above doesn''t work, try setting vertex diffuse color to green, or use a plain green texture.
With regards to your other question, Direct3D will apply a default material (again, if i remeber correctly) to an object, and so in effect you always have a material present (i think it''s a basic matte white material), even tho you don''t specify a material explicitly.
If you want a green cube, but find that the material + no light thing above doesn''t work, try setting vertex diffuse color to green, or use a plain green texture.
quote:Original post by mickey
i''d like to color my cube green by using materials, but i don''t want lightings enable. how?
Set the LIGHTING renderstate to off, and use the diffuse colour for vertices, and don''t specify normals. See the DirectX SDK on "lit vertices" for details.
quote:
also, i want to use textures plus lightings but no materials. Is this possible?
Sure is, the easiest way is probably to just set the material to white.
- JQ
Full Speed Games. Coming soon.
Set D3DRS_LIGHTING to 1, and D3DRS_AMBIENT to white. Then use the green material to color your object (use the "Ambient" set of data in the material).
Z.
Z.
hiya guys thanks for the reply..,
johnnyquest: ehm, no, i don''t want to use those alternatives..., i have xyz, normals and tu/tv only on my vertex structures, don''t want to add anymore... and nono materials for lightings, just textures + lightings...
ehm guys, no sort of lightings, just materials.., because i don''t need these combinations, materials+lightings and materials+lightings+textures.
johnnyquest: ehm, no, i don''t want to use those alternatives..., i have xyz, normals and tu/tv only on my vertex structures, don''t want to add anymore... and nono materials for lightings, just textures + lightings...
ehm guys, no sort of lightings, just materials.., because i don''t need these combinations, materials+lightings and materials+lightings+textures.
I think what they''re trying to say, is that materials alone cannot colour your objects. They just reflect light. So you''d need lit vertices or ambient lighting.
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
One other option is to set the emissive color of your material. That should make it glow without using external lighting.
Domenic, Underdog
http://www.unitedunderdogs.com
Domenic, Underdog
http://www.unitedunderdogs.com
quote:Original post by mickey
hiya,
i''d like to color my cube green by using materials, but i don''t want lightings enable. how?
no you cant, you need a light. colour your vertices.
quote:
also, i want to use textures plus lightings but no materials. Is this possible?
many thanks,
dont think so , i might be mistaken.
quote:Original post by dommer2029
One other option is to set the emissive color of your material. That should make it glow without using external lighting.
Domenic, Underdog
http://www.unitedunderdogs.com
oh yeah, though i have to turn off all my lightings in the scene and leave D3DRS_LIGHTING to TRUE, well i guess, materials are really for lightings only, and i''ve got no other ways...,
also, there''s another one, i''d like to fade my object slowly without locking and changing alpha values of my vertex diffuse color(because i don''t have em), i know there''s an alternative but search is down so i won''t be able to find it.
thanks!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement