Help Request: Clouds Layers suggestion
hey all,
check out this image:
http://www.hero-interactive.com/images/gallery/robotech3d/newtitle.jpg
I want to add a layer of clouds scrolling by slowly below the planes and also make the planes relective and how some sort of layer of clouds which reflects off of them and flows over them but isn't rendered themselves...
any tips?
Also anyone have some good pointers on how to make skymaps and spherical environmaps?
SkullOne - Hero Interactive
http://www.hero-interactive.com
Yahoo! ID: zoomCrypt
Edited by - zoomCrypt on January 14, 2002 3:36:58 AM
Edited by - zoomCrypt on January 14, 2002 3:42:45 AM
One suggestion is to have a textured quad ( quite large ) and position it at a given y coord below the planes.Then use the texture transformation matrix when drawing this object to scroll the texture on it. ( see SetTransform() ).
For the plane relefection you can put a second texture layer on the objects, and set up an enviroment texture, (again using SetTransform() ).
for the render states off the top of my head I think its something like this
I suggest looking at the DX8 3D Enviroment mapping samples, namely the sphere mapping on how to set up the texture matrix proplerly.
Hope this gives you some ideas.
For the plane relefection you can put a second texture layer on the objects, and set up an enviroment texture, (again using SetTransform() ).
for the render states off the top of my head I think its something like this
//layer 1 is enviroment mapDXDisplay->SetTexture( 1, TexHandle );DXDisplay->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );DXDisplay->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );DXDisplay->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );
I suggest looking at the DX8 3D Enviroment mapping samples, namely the sphere mapping on how to set up the texture matrix proplerly.
Hope this gives you some ideas.
Alright!!
That totallly worked easily! Thanks for the advice....
I replaced the old image with a screen cap of the new version with clouds underneath! Very nice! I love the texture Transform matrix!
ToDo list:
- environment mapped clouds on planes
- Pick background music
- lensflare
Man this is going to make a great screen saver!
mail me at info@hero-interactive.com if you want to try it out.
Thanks again for the help!
Yahoo! ID: zoomCrypt
Edited by - zoomCrypt on January 14, 2002 6:37:50 AM
That totallly worked easily! Thanks for the advice....
I replaced the old image with a screen cap of the new version with clouds underneath! Very nice! I love the texture Transform matrix!
ToDo list:
- environment mapped clouds on planes
- Pick background music
- lensflare
Man this is going to make a great screen saver!
mail me at info@hero-interactive.com if you want to try it out.
Thanks again for the help!
Yahoo! ID: zoomCrypt
Edited by - zoomCrypt on January 14, 2002 6:37:50 AM
Ok trying to do environment mapping and looking at the cubemap sample. isn''t there an easier way to do this?
Yahoo! ID: zoomCrypt
Yahoo! ID: zoomCrypt
See if the following is of any help
Set up render states as follows: (note you may want to use MODULATE instead of MODULATE2X )
The Stage 1 stuff is the important stuff
Then when drawing the object Set the enviroment texture as follows:-
Set your object textures as normal.
Then set a texture transform matrix: The below is from the sphere map example,
Note most probably want to take components out of your object/camera matrix
to make it more intresting..
Set up render states as follows: (note you may want to use MODULATE instead of MODULATE2X )
The Stage 1 stuff is the important stuff
DXDisplay->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); DXDisplay->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE2X ); DXDisplay->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); DXDisplay->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); DXDisplay->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); DXDisplay->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); DXDisplay->SetTextureStageState( 0, D3DTSS_MAGFILTER ,D3DTEXF_LINEAR ); DXDisplay->SetTextureStageState( 0, D3DTSS_MINFILTER ,D3DTEXF_LINEAR ); DXDisplay->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_CURRENT ); DXDisplay->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_MODULATE ); DXDisplay->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_TFACTOR ); DXDisplay->SetTextureStageState( 1, D3DTSS_ALPHAARG1, D3DTA_CURRENT ); DXDisplay->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_MODULATE ); DXDisplay->SetTextureStageState( 1, D3DTSS_ALPHAARG2, D3DTA_TFACTOR ); DXDisplay->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU ); DXDisplay->SetTextureStageState( 1, D3DTSS_MAGFILTER, D3DTEXF_LINEAR ); DXDisplay->SetTextureStageState( 1, D3DTSS_MINFILTER, D3DTEXF_LINEAR );
Then when drawing the object Set the enviroment texture as follows:-
if( DoEnvMap ){ DXDisplay->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE ); DXDisplay->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1 ); DXDisplay->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); DXDisplay->SetTexture( 1, TexHandle );}else{ DXDisplay->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_CURRENT ); DXDisplay->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_MODULATE ); DXDisplay->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); DXDisplay->SetTexture( 1, NULL );}
Set your object textures as normal.
Then set a texture transform matrix: The below is from the sphere map example,
D3DXMATRIX mat;mat._11 = 0.5f; mat._12 = 0.0f; mat._13 = 0.0f; mat._14 = 0.0f; mat._21 = 0.0f; mat._22 =-0.5f; mat._23 = 0.0f; mat._24 = 0.0f; mat._31 = 0.0f; mat._32 = 0.0f; mat._33 = 1.0f; mat._34 = 0.0f; mat._41 = 0.5f; mat._42 = 0.5f; mat._43 = 0.0f; mat._44 = 1.0f; DXDisplay->SetTransform( D3DTS_TEXTURE1, &mat );
Note most probably want to take components out of your object/camera matrix
to make it more intresting..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement