Bump Maping???

Started by
0 comments, last by Human_AI 23 years, 10 months ago
Hi, I can''t seem to find any good examples of how to use bump maping in D3D IM. I''ve tried using the code from the sdk documentation, but it doesn''t work -> ---------------------------------------- '' Stage 0: the base texture g_d3ddevice.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE) g_d3ddevice.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE) g_d3ddevice.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE) g_d3ddevice.SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1) g_d3ddevice.SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE) '' Stage 1: the bump map '' Use luminance for this example. g_d3ddevice.SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BUMPENVMAPLUMINANCE) g_d3ddevice.SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE) g_d3ddevice.SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT) '' Stage 2: a specular environment map g_d3ddevice.SetTextureStageState(2, D3DTSS_TEXCOORDINDEX, 0) g_d3ddevice.SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_ADD) g_d3ddevice.SetTextureStageState(2, D3DTSS_COLORARG1, D3DTA_TEXTURE) g_d3ddevice.SetTextureStageState(2, D3DTSS_COLORARG2, D3DTA_CURRENT) '' Set the bump mapping matrix. g_d3ddevice.SetTextureStageStateSingle(1, D3DTSS_BUMPENVMAT00,1#) g_d3ddevice.SetTextureStageStateSingle(1, D3DTSS_BUMPENVMAT01,0#) g_d3ddevice.SetTextureStageStateSingle(1, D3DTSS_BUMPENVMAT10,0#) g_d3ddevice.SetTextureStageStateSingle(1, D3DTSS_BUMPENVMAT11,1#) g_d3ddevice.SetTextureStageStateSingle(1, D3DTSS_BUMPENVLSCALE, 0.5) g_d3ddevice.SetTextureStageStateSingle(1, D3DTSS_BUMPENVLOFFSET, 0#) g_d3ddevice.SetRenderState D3DRENDERSTATE_ALPHABLENDENABLE, True ---------------------------------------- Thanks for the help.
Advertisement
try www.nvidia.com/developer.nsf

- WitchLord

Edited by - WitchLord on June 28, 2000 1:34:30 AM

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement