Sign in to follow this  
Baesky

if i use a texture, dx10 will automatically illuminate it?

Recommended Posts

Baesky    167

here are some code came from SDK, i didn't found any lighting calc here, but i can see the object.I remeber that in dx9 if i don't set the light state or enable it with shader, i just saw a black screen.
any one could explain it?Thanks!

float4 PS( PS_INPUT input) : SV_Target

{

return txDiffuse.Sample( samLinear, input.Tex )* vMeshColor;

}

Share this post


Link to post
Share on other sites
Hodgman    51328
When using shaders (which you [i]have[/i] to do in DX10), there is no lighting, except what is done in the shader. If you shader doesn't include lighting code, then your objects won't be darkened/brightened by lights... They will be the colour that is output by that [font="Courier New"]return[/font] statement.

Share this post


Link to post
Share on other sites
Aqua Costa    3692
In DirectX 10 there isnt any automatic lighting calculations...
You have to do everything for yourself.
Check the DirectX SDK tutorials or read [url="http://wiki.gamedev.net/index.php/D3DBook:Lighting"]this website[/url].

Share this post


Link to post
Share on other sites
Baesky    167
thanks a lot, now i know more about light.[img]http://public.gamedev.net/public/style_emoticons/default/rolleyes.gif[/img]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this