rear view mirror using stencil buffer

hi all,

iam displaying a vehicle rear view mirror using stencil buffer. my problem is when iam

displaying this its only showing the objects which are rendered lastly. can anyone help me . or am i using wrong principle by using stencil buffer ,because iam 30 days buddy

for direct3d programming. any other solutions are also welcome

bye

have a bug free day



Answer this question

rear view mirror using stencil buffer

  • Ed Casey

    Do you have change your View Transformation before you have render the mirror content



  • JMZuniga

    I am not sure what you are mean with “rendered lastly”. Do you mean that what you see depends on the order you draw it or something else

    Using the Stencil buffer for mirrors is OK but today it is more typical to use “Render 2 Texture” for mirror effects. This mean you render anything you want to see in the mirror in a texture and than render the mirror itself with this texture.



  • jn____

    thank u sir,

    iam rendering like this . soppose there are 3 teapot objects infront of the mirror

    iam rendering like this

    by setting the stencil buffer

    tepot1->DrawSubset(0);

    tepot2->DrawSubset(0);

    teapot3->DrawSubset(0);

    in this case mirror is showing only 3 rd object even though all objects are infront of mirror.

    anyway i thindk rendering to texture is better idea . but i want to know what's wrong with my code

    bye sir


  • rear view mirror using stencil buffer