Directx - Drawing Prmitives vs. Meshes  (Lighting issues)

Posted on 2006-05-23
Last Modified: 2013-12-26
If I draw a primitive (triangle strip for example) with vertices setup with this FVF:


I understand that I can expect no shadowing whatsoever even if lighting is turned on.

This is because there are no normals in this FVF, correct?
- Or do normals even go in the FVF?
- Would I have a normal vector?

When I'm drawing a mesh (.X), normals are calculated for every triangle (if I remember correctly).
- Therefore, I can create a directional light source (like the sun) and pretty shadows will appear
- Even if the vertices have only colors & positions, shadows will appear
- By shadows I mean brigter and darker triangles corresponding to their angle to the light source
- Am I correct here ?

I'm a bit rusty on this directx stuff, it's been a while for me.

I'm trying to nail this stuff down in my brain so that I can proceed with more complicated stuff.


Question by:oxygen_728
    LVL 1

    Accepted Solution

    I'm not developing in C++, and I'm using C# with the DirectX 10 SDK. If you create a mesh with the FVF that doesn't have normals, calling a D3DX method that computes normals will throw an exception. If you create a mesh with normals you can specify the vertex information (ommiting the vertex normal vectors) and later call the D3DX compute normals method.

    Triangles without normals will only use the material diffuse color *even with lighting enabled*. I tested this on my hardware device AND the reference device. To have any lighting you need vertex normals.


    Author Comment


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
    As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now