   problems rendering simple mesh plane *solved with help
  :: SEE LAST POST[Edited by - Dragon_Strike on September 5, 2007 4:45:30 PM]
  If you don`t see the terrain at all, and you don`t have errors when compiling>,, so you would check camera view port   ;  ive alrdy checked the viewport by rendering a box at the same place where the terrain should be... and i can see the box but not the terrain...no compiler errors   ;  Try clearing your background to something other than black so you can see if your terrain is rendering as black.  If it is, then check all your lighting setup.   ;  no lighting, white background... same settings as box...#include "DXUT.h"#include "DXUTcamera.h"#include "resource.h"#include "World.h"CFirstPersonCamera g_Camera;  // A model viewing cameraD3DXMATRIX* g_pWorld = NULL;D3DXMATRIX* g_pView= NULL;D3DXMATRIX* g_pProjection = NULL;World* g_World;const int ScreenWidth = 1024;const int ScreenHeight = 768;//--------------------------------------------------------------------------------------// Rejects any D3D9 devices that aren't acceptable to the app by returning false//--------------------------------------------------------------------------------------bool CALLBACK IsD3D9DeviceAcceptable( D3DCAPS9* pCaps, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, bool bWindowed, void* pUserContext ){    // Typically want to skip back buffer formats that don't support alpha blending    IDirect3D9* pD3D = DXUTGetD3D9Object();if( FAILED( pD3D->CheckDeviceFormat( pCaps->AdapterOrdinal, pCaps->DeviceType,AdapterFormat, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3DRTYPE_TEXTURE, BackBufferFormat ) ) )   return false;    return true;}//--------------------------------------------------------------------------------------// Before a device is created, modify the device settings as needed//--------------------------------------------------------------------------------------bool CALLBACK ModifyDeviceSettings( DXUTDeviceSettings* pDeviceSettings, void* pUserContext ){return true;}//--------------------------------------------------------------------------------------// Create any D3D9 resources that will live through a device reset (D3DPOOL_MANAGED)// and aren't tied to the back buffer size//--------------------------------------------------------------------------------------HRESULT CALLBACK OnD3D9CreateDevice( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext ){// Initialize the camera    D3DXVECTOR3 Eye( 0.0f, 0.0f, -10.0f );    D3DXVECTOR3 At( 0.0f, 0.0f, 0.0f );    g_Camera.SetViewParams( &Eye, &At );g_Camera.SetRotateButtons(true,false,false,false);g_Camera.SetEnablePositionMovement( true );// Setup the camera's projection parameters    float fAspectRatio = pBackBufferSurfaceDesc->Width / (FLOAT)pBackBufferSurfaceDesc->Height;    g_Camera.SetProjParams( D3DX_PI/4, fAspectRatio, 0.1f, 5000.0f );pd3dDevice->SetTransform(D3DTS_PROJECTION, g_Camera.GetProjMatrix());pd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);g_World = new World(pd3dDevice);    return S_OK;}//--------------------------------------------------------------------------------------// Create any D3D9 resources that won't live through a device reset (D3DPOOL_DEFAULT) // or that are tied to the back buffer size //--------------------------------------------------------------------------------------HRESULT CALLBACK OnD3D9ResetDevice( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext ){    return S_OK;}//--------------------------------------------------------------------------------------// Handle updates to the scene.  This is called regardless of which D3D API is used//--------------------------------------------------------------------------------------void CALLBACK OnFrameMove( double fTime, float fElapsedTime, void* pUserContext ){g_Camera.FrameMove((float)fTime);}//--------------------------------------------------------------------------------------// Render the scene using the D3D9 device//--------------------------------------------------------------------------------------void CALLBACK OnD3D9FrameRender( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext ){HRESULT hr;pd3dDevice->SetTransform(D3DTS_VIEW, g_Camera.GetViewMatrix());    // Clear the render target and the zbufferV( pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0, 45, 50, 170), 1.0f, 0) );// Render the scene    if( SUCCEEDED( pd3dDevice->BeginScene() ) )    {//pd3dDevice->SetTransform(D3DTS_WORLD, g_Camera.GetWorldMatrix());//pd3dDevice->SetTransform(D3DTS_PROJECTION, g_Camera.GetProjMatrix());pd3dDevice->Clear(0, 0,D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,0xffffffff, 1.0f, 0);pd3dDevice->BeginScene();g_World->Render();   V( pd3dDevice->EndScene() );    }}//--------------------------------------------------------------------------------------// Handle messages to the application //--------------------------------------------------------------------------------------LRESULT CALLBACK MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,  bool* pbNoFurtherProcessing, void* pUserContext ){    // Pass all remaining windows messages to camera so it can respond to user input    g_Camera.HandleMessages( hWnd, uMsg, wParam, lParam );    return 0;}//--------------------------------------------------------------------------------------// Release D3D9 resources created in the OnD3D9ResetDevice callback //--------------------------------------------------------------------------------------void CALLBACK OnD3D9LostDevice( void* pUserContext ){}//--------------------------------------------------------------------------------------// Release D3D9 resources created in the OnD3D9CreateDevice callback //--------------------------------------------------------------------------------------void CALLBACK OnD3D9DestroyDevice( void* pUserContext ){delete g_World;}//--------------------------------------------------------------------------------------// Initialize everything and go into a render loop//--------------------------------------------------------------------------------------INT WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int ){    // Enable run-time memory check for debug builds.#if defined(DEBUG) | defined(_DEBUG)    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );#endif    // Set the callback functions    DXUTSetCallbackD3D9DeviceAcceptable( IsD3D9DeviceAcceptable );    DXUTSetCallbackD3D9DeviceCreated( OnD3D9CreateDevice );    DXUTSetCallbackD3D9DeviceReset( OnD3D9ResetDevice );    DXUTSetCallbackD3D9FrameRender( OnD3D9FrameRender );    DXUTSetCallbackD3D9DeviceLost( OnD3D9LostDevice );    DXUTSetCallbackD3D9DeviceDestroyed( OnD3D9DestroyDevice );    DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );    DXUTSetCallbackMsgProc( MsgProc );    DXUTSetCallbackFrameMove( OnFrameMove );    // TODO: Perform any application-level initialization here    // Initialize DXUT and create the desired Win32 window and Direct3D device for the application    DXUTInit( true, true ); // Parse the command line and show msgboxes    DXUTSetHotkeyHandling( true, true, true );  // handle the default hotkeys    DXUTSetCursorSettings( true, true ); // Show the cursor and clip it when in full screen    DXUTCreateWindow( L"Project" );    DXUTCreateDevice( true, ScreenWidth, ScreenHeight );    // Start the render loop    DXUTMainLoop();    // TODO: Perform any application-level cleanup here    return DXUTGetExitCode();};  This might not be the cause of the problem, but it's not right so it might be it. In your FVF code, you are specifying position and texture coordinates (D3DFVF_XYZ | D3DFVF_TEX1) even though your vertex structure only has position data. You should either remove D3DFVF_TEX1 or add texture coordinates to your vertex structure (another two floats).   ;Quote:Original post by hikikomori-sanThis might not be the cause of the problem, but it's not right so it might be it. In your FVF code, you are specifying position and texture coordinates (D3DFVF_XYZ | D3DFVF_TEX1) even though your vertex structure only has position data. You should either remove D3DFVF_TEX1 or add texture coordinates to your vertex structure (another two floats).yea i forgot to remove that when i tried to remove all the unnecessary stuff to troubleshoot it...thx... but it didnt solve itcould someone jsut copy paste it into a soluton and try it? maybe its my laptop drivers that are out of date ( and which i cant get updated until my laptop manufacturer releases new ones...)... VERY unlikely.. but i cant figure it out[Edited by - Dragon_Strike on September 3, 2007 2:09:40 PM];  Try disabling back face culling - it bit me a few times!   ;  nope.. didnt help   ;  solved it... rewrote the buffer init code...   