Directx9 Mirror Image

How to implement texture loading, which will be used as a mirror map for part of the geometry and rendering it in Directx9 using C ++?

Are there any tutorials or basic examples that I can reference?

+4
source share
1 answer

Use D3DXCreateTextureFromFile to load a file from disk. Then you need to set up a shader that multiplies the mirror value by the value stored in the texture. It gives you a mirror color.

So, you are the final pixel coming from

Final = ambient + (NL * texture colour) + (NH * texture specular) 

You can do this easily in the shader.

It is also worth noting that it can be very useful to store the mirror in texel in the alpha channel of the texture. This way, you only need one texture around, although it breaks the transparency in pixels.

+6
source

Source: https://habr.com/ru/post/1302100/


All Articles