1 registered members (AndrewAMD),
1,261
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: uv-offset texture formats
[Re: ventilator]
#26581
05/15/04 05:39
05/15/04 05:39
|
Joined: Oct 2003
Posts: 1,258 Virginia, USA
qwerty823
Senior Developer
|
Senior Developer
Joined: Oct 2003
Posts: 1,258
Virginia, USA
|
Not sure, but you cant control what gets used when calling bmap_to_uv, unless you know of some other way.
Never argue with an idiot. They drag you down to their level then beat you with experience
|
|
|
Re: uv-offset texture formats
[Re: ventilator]
#26583
05/15/04 05:57
05/15/04 05:57
|
Joined: Oct 2003
Posts: 1,258 Virginia, USA
qwerty823
Senior Developer
|
Senior Developer
Joined: Oct 2003
Posts: 1,258
Virginia, USA
|
well, maybe. I did do something similar for increasing the depth/stencil buffer, but changing the depth/stencil buffer is quite a bit easier then swaping out one texture for the same texture of a different format.
Last edited by qwerty823; 05/15/04 06:02.
Never argue with an idiot. They drag you down to their level then beat you with experience
|
|
|
Re: uv-offset texture formats
[Re: qwerty823]
#26584
05/15/04 06:08
05/15/04 06:08
|
Joined: Dec 2003
Posts: 1,097 Maryland, USA
Steempipe
Serious User
|
Serious User
Joined: Dec 2003
Posts: 1,097
Maryland, USA
|
Quote:
Just a few things to note:
Loading a bmp, the format becomes D3DFMT_R5G6B5 ( 23 ) Loading a tga, the format becomes D3DFMT_X8R8G8B8 ( 22 )
Calling bmap_to_uv(), makes it D3DFMT_V8U8 ( 60 ) Calling bamp_to_normals(), makes it D3DFMT_A8R8G8B8 ( 21 )
The Miscrosoft BumpWaves.Cpp evidentally generates these:
Code:
// Load the texture for the background image if( FAILED( D3DUtil_CreateTexture( m_pd3dDevice, _T("Lake.bmp"), &m_pBackgroundTexture, D3DFMT_R5G6B5 ) ) ) return D3DAPPERR_MEDIANOTFOUND;
// Create the bumpmap. m_psBumpMap = CreateBumpMap( 256, 256, D3DFMT_V8U8 ); if( NULL == m_psBumpMap ) return E_FAIL;
|
|
|
Re: uv-offset texture formats
[Re: ventilator]
#26587
05/15/04 06:24
05/15/04 06:24
|
Joined: Oct 2003
Posts: 1,258 Virginia, USA
qwerty823
Senior Developer
|
Senior Developer
Joined: Oct 2003
Posts: 1,258
Virginia, USA
|
I dont have it installed on the machine that has my Gf4ti4200, but it is shared from another. Testing...
Nope, gives an error. Says cant load the required media. (not very helpful)
Last edited by qwerty823; 05/15/04 06:24.
Never argue with an idiot. They drag you down to their level then beat you with experience
|
|
|
Re: uv-offset texture formats
[Re: qwerty823]
#26588
05/15/04 06:27
05/15/04 06:27
|
Joined: Sep 2003
Posts: 3,236 San Diego, CA
Marco_Grubert
Expert
|
Expert
Joined: Sep 2003
Posts: 3,236
San Diego, CA
|
Bumpwaves works on GF3/4. Running with X8R8G8B8 format and Vertex Shaders.
Here's the relevant code:
Code:
Init:
// Create the bumpmap.
m_psBumpMap = CreateBumpMap( 256, 256, D3DFMT_V8U8 );
------
Renderstates:
m_pd3dDevice->SetTexture( 0, m_psBumpMap );
m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
m_pd3dDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BUMPENVMAT00, F2DW( m_matBumpMat._11 ) );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BUMPENVMAT01, F2DW( m_matBumpMat._12 ) );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BUMPENVMAT10, F2DW( m_matBumpMat._21 ) );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BUMPENVMAT11, F2DW( m_matBumpMat._22 ) );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BUMPENVLSCALE, F2DW(0.8f) );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_BUMPENVLOFFSET, F2DW(0.0f) );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_BUMPENVMAPLUMINANCE );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_CURRENT );
// Set up texture stage 1's states for the environment map
m_pd3dDevice->SetTexture( 1, m_pBackgroundTexture );
m_pd3dDevice->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
m_pd3dDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
---------
Vertex shader:
vs.1.1
dcl_position v0
dcl_texcoord v1
m4x4 oPos, v0, c3 ; transform position to the projection space
; Compute vertex position in the camera space - this is our texture coordinates
dp4 r0.x, v0, c0
dp4 r0.y, v0, c1
dp4 r0.z, v0, c2
; Do the rest of texture transform (first part was combined with the camera matrix)
rcp r0.z, r0.z
mad oT1.x, r0.x, r0.z, c8.x
mad oT1.y, r0.y, r0.z, c8.y
mov oT0.xy, v1 ; Copy input texture coordinates for the stage 0;
@qwerty: make sure you have the paths set up correctly..
Last edited by Marco_Grubert; 05/15/04 06:39.
|
|
|
Re: uv-offset texture formats
[Re: Marco_Grubert]
#26589
05/15/04 06:29
05/15/04 06:29
|
Joined: Oct 2003
Posts: 1,258 Virginia, USA
qwerty823
Senior Developer
|
Senior Developer
Joined: Oct 2003
Posts: 1,258
Virginia, USA
|
I just thought of that (since it was running from a share), so it's copying over to the machine now.
Edit: Now that i have it local, it works. Sorry for the scare everyone! ![](/ubbthreads/images/graemlins/wink.gif)
Last edited by qwerty823; 05/15/04 06:37.
Never argue with an idiot. They drag you down to their level then beat you with experience
|
|
|
|