|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Simple Clouds Part 1 |
|
![]() McGyverDK Member since: 7/15/2003 From: Denmark |
||||
|
|
||||
| In OpenGL you have the function gluBuild2DMipmaps. Does the Texture class in DirectX have any methods to load data from an array into it? |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Almost the same as Hugo Elias <a href="http://freespace.virgin.net/hugo.elias/models/m_clouds.htm">article</a>? |
||||
|
||||
![]() UltimaX Member since: 3/27/2003 From: Ashland, OH, United States |
||||
|
|
||||
quote: Yeah, but not that easy:
LPDIRECT3DTEXTURE8 Texture;
D3DLOCKED_RECT RC;
//
HRESULT Result = GD3DDEVICE->CreateTexture(Width, Height, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, &Texture);
if(FAILED(Result))
{
return false;
}
//
Texture->LockRect(0, &RC, 0, 0);
unsigned char* Pixels = (unsigned char*)RC.pBits;
unsigned short* DPixels;
//
for(Y = 0; Y < Height; Y++)
{
DPixels = (unsigned short*)Pixels;
for(X = 0; X < Width; X++)
{
//--Set Pixel Color
*DPixels++ = PixelColor;
}
Pixels += RC.Pitch;
}
Texture->UnlockRect(0);
-UltimaX- Ariel Productions |Designing A Screen Shot System| "You wished for a white christmas... Now go shovel your wishes!" |
||||
|
||||
![]() Cipher3D Member since: 8/12/2001 From: Irvine, CA, United States |
||||
|
|
||||
| IT WORKS! YES! I MADE IT WORK! i still don't have a clue why it works. i.e. can anybody point me to a better Perlin Noise tutorial? One that actually explains how it works? |
||||
|
||||
![]() UltimaX Member since: 3/27/2003 From: Ashland, OH, United States |
||||
|
|
||||
quote: Noise -UltimaX- Ariel Productions |Designing A Screen Shot System| "You wished for a white christmas... Now go shovel your wishes!" |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Some credit to Mr Elias would have been nice. His site has some amazing stuff (http://freespace.virgin.net/hugo.elias/), so you really should have linked him at the very least. |
||||
|
||||
![]() Freestyler Member since: 4/16/2008 |
||||
|
|
||||
| I'm wondering if a kind soul, has the source-code to this tutorial.? http://www.gamedev.net/reference/articles/article2085.asp I'm getting a few errors, when i tried to compile, when i copied the text from the page. I'm fairly much a newbie and have limited C and OGL skills. I do however understand most of what is happening, but i was hoping to compile this example and simplify.... I'm looking for C Source and not C++ which is all i seem to find when looking for similar examples. The example tutorial is actually a little more advanced than what I'm trying to do. Eventually i would like to do my own terrain displacement, but for now the following would suffice. I'm trying to simply: 1)Make a texture array, 2)Generate procedural noise 3)Fill Map array with a random procedural noise, 4)Display the array via OGL. Any help on getting this a step further would be appreciated. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|