rendering in gameworld menu

User Tag List

Page 3 of 3 FirstFirst 123
Results 31 to 39 of 39
  1. #31
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...


    well, i discovered that it's not becoming darker/lighter, it's more/less transparent :P

    so i tried setting the various alpha settings:
    Code:
    			pDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);				
    			pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
    			pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
    			pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    			pDevice->SetRenderState(D3DRS_ALPHAREF, 0x00000001);
    			pDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
    but this didn't help :/

    rendering in gameworld
  2. #32
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by mnbvc View Post
    ...


    well, i discovered that it's not becoming darker/lighter, it's more/less transparent :P

    so i tried setting the various alpha settings:
    Code:
                pDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);                
                pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
                pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
                pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
                pDevice->SetRenderState(D3DRS_ALPHAREF, 0x00000001);
                pDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
    but this didn't help :/
    Shit, i remember that one actually. Sorry, this should do the trick:

    Code:
        m_pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
        m_pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
        m_pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
    
        m_pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_DISABLE );
        m_pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE );

  3. #33
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it seems that
    m_pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_DISABLE );
    m_pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE );
    has just the same effect like pDevice->SetTexture(0, NULL);
    one of both is needed to see anything

    and if i include setting the alpha values or not doesn't change anything, it seems to be set by wow anyway (maybe there are situations where it isn't, who knows...)

    but by setting D3DTSS_COLOROP and D3DTSS_ALPHAOP to D3DTOP_ADD i found out that there is much more happening:

    currently i don't know how this helps me, but it's "interesting" :confused:

  4. #34
    youmew's Avatar Member
    Reputation
    13
    Join Date
    Feb 2007
    Posts
    28
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey all
    I'm trying to make some render in the game but unfortunately i'm getting weird results :


    the triangle is always moving when i change the camera position,
    Its just like if the triangle was watching from the sky Oo


    my source :
    Code:
         cam = *getDevice();
           
           
            D3DTLVERTEX vertices[] =
            {
                { 0.0f, 0.0f, 5.0f, 0xff00ff00 },
                { 5.0f, 0.0f, 0.0f, 0xff0000ff },
                { -5.0f, 0.0f, 0.0f, 0xffff0000 }
    
            };
    
            DeviceP->SetVertexShader(NULL);
            DeviceP->SetPixelShader(NULL);
    
           
            //D3DXMatrixIdentity(&World);
           
            //getDevice()->fPos = getDevice()->fPos + 100.0f;
           
           
            D3DXVECTOR3 mew(0, 0, 1.0f);
            D3DXMatrixTranslation(&World, -6225.297f, 332.9926f, 383.205f);
    
            D3DXVECTOR3 vEyePt( cam.fPos[0], cam.fPos[1], cam.fPos[2] );
            D3DXVECTOR3 vLookatPt( cam.fPos[0]+cam.fViewMat[0][0], cam.fPos[1]+cam.fViewMat[0][1], cam.fPos[2]+cam.fViewMat[0][2] );
            D3DXVECTOR3 vUpVec( 0.0f, 0.0f, 1.0f );
            D3DXMatrixLookAtRH( &View, &vEyePt, &vLookatPt, &vUpVec );
    
            D3DXMatrixPerspectiveFovLH(&Proj,cam.fFov * 0.6f,cam.aspect,cam.zNearPlane, cam.zFarPlane);
           
            DeviceP->SetTransform(D3DTS_WORLD, &World);
            DeviceP->SetTransform(D3DTS_VIEW, &View);
            DeviceP->SetTransform(D3DTS_PROJECTION, &Proj);
    
    
            DeviceP->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
            DeviceP->SetTexture(0, NULL);
            DeviceP->SetRenderState( D3DRS_AMBIENT, 0xff7f7f7f );
            DeviceP->SetRenderState( D3DRS_LIGHTING, 1 );
           
            //DeviceP->SetRenderState( D3DRS_CULLMODE , 0);
            DeviceP->GetTransform(D3DTS_WORLD,&World);
            DeviceP->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
            DeviceP->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
            DeviceP->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
            DeviceP->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, sizeof( vertices ) / sizeof( vertices[0] ) - 2, &vertices[0], sizeof(vertices[0]));
    thanks for any help / advice
    and sorry for the large pic :/

    EDIT :managed to get it working with the forward() method , but still having some issues with textures and meshes :


    it seems that there is a mismatch with the coordinates of textures , but being a noob in directx i cant find by myself how to fix it :s
    Last edited by youmew; 04-23-2010 at 03:16 PM.

  5. #35
    martinochsan's Avatar Member
    Reputation
    -9
    Join Date
    Sep 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What libary/dll do you use to directX?

  6. #36
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    probably d3d9.lib/d3d9.dll

  7. #37
    martinochsan's Avatar Member
    Reputation
    -9
    Join Date
    Sep 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SKU View Post
    probably d3d9.lib/d3d9.dll
    Ok thanks for answer, but d3d9.dll is not a valid compoment =/
    Last edited by martinochsan; 10-25-2010 at 10:56 AM.

  8. #38
    PyGuy's Avatar Corporal
    Reputation
    14
    Join Date
    Jan 2011
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm attempting to render with the zbuffer enabled, but its not working correctly. If I render without the zbuffer, everything shows up where its supposed to with the correct colors, orientation, etc. However when I turn on the zbuffer, all my polys simply disappear. Here's the code I'm using to setup the Direct3D state:

    Code:
    void SetupWorld(IDirect3DDevice9* device, IDirect3DStateBlock9* stateBlock, bool useZBuffer)
    {
    	// Capture the current state before we mess with it
    	stateBlock->Capture();
    
    	// Set the min and max on the viewport so that our stuff doesn't draw over the UI
    	D3DVIEWPORT9 viewport;
    	device->GetViewport(&viewport);
    	viewport.MinZ = 0.0f;
    	viewport.MaxZ = 0.94f;
    	device->SetViewport(&viewport);
    
    	// Zero out the vertex and pixel shaders and prevent Blizzard from texturing our polys
    	device->SetVertexShader(NULL);
    	device->SetPixelShader(NULL);
    	device->SetTexture(0, NULL);
    
    	// Set the vertex format to use 3D position and a single color per vertex
    	device->SetFVF(D3DFVF_XYZ | D3DFVF_DIFFUSE);
    
    	// Setup the zbuffer
    	if (useZBuffer)
    	{
    		device->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
    		device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
    		device->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
    	}
    	else
    		device->SetRenderState(D3DRS_ZENABLE, FALSE);
    
    	// Turn off lighting and backface culling
    	device->SetRenderState(D3DRS_LIGHTING, FALSE);
    	device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
    
    	// Prevent Blizzard from setting the alpha of our polygons on mouseover
    	device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
    	device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
    	device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
    }
    This is all called from an EndScene detour (using HadesMem, thank you Cypher). If useZBuffer is false, all polygons draw but obscure the players, npcs, etc. If useZBuffer is true, the game world renders correctly but my polygons aren't there.

    Is Blizzard doing something to the zbuffer when its drawing the UI? Maybe filling it with 0.94 or something and thus my polys always test as 'behind'. Should I be detouring a different function? Is there an obvious flaw with my code? Where am I going wrong here?

  9. #39
    PyGuy's Avatar Corporal
    Reputation
    14
    Join Date
    Jan 2011
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After playing around with it longer, I determined that the previous value of 0.94 is no longer correct. As of 4.0.6.13623 the value should be viewport.MaxZ = 0.92f;

    I suspect that Blizzard is rendering the UI in layers where each layer gets its own z-index (0.93, 0.94, 0.95 etc) and that there happen to be 8 layers now instead of 6. Can anyone confirm this?

    Also, my polygons still render on top of some UI elements (such as text in the chat frame) but not on top of others (such as the chat frame itself). Is this because Blizzard is doing device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); when drawing these elements and thus they draw but the zbuffer isn't saved?

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Some rendered WoW art (not for the faint of modem)
    By Pinkhair in forum Art & Graphic Design
    Replies: 33
    Last Post: 09-28-2007, 04:59 AM
  2. Musters guide to: Making WoW renders.(Warning Pictures!)
    By Adrenalin3 in forum Art & Graphic Design
    Replies: 11
    Last Post: 08-28-2007, 02:02 PM
  3. renders
    By Sekspyz in forum Art & Graphic Design
    Replies: 5
    Last Post: 08-16-2007, 06:06 PM
  4. Where to get a render?
    By lohkies in forum Art & Graphic Design
    Replies: 2
    Last Post: 03-06-2007, 04:25 PM
  5. How do I render Vid's in fraps?
    By theillbehaviored in forum World of Warcraft General
    Replies: 0
    Last Post: 09-25-2006, 09:54 AM
All times are GMT -5. The time now is 08:26 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search