Home » Community » Forums » » Simple Clouds Part 1
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Simple Clouds Part 1
Post Reply 
In OpenGL you have the function gluBuild2DMipmaps. Does the Texture class in DirectX have any methods to load data from an array into it?



 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Almost the same as Hugo Elias <a href="http://freespace.virgin.net/hugo.elias/models/m_clouds.htm">article</a>?

 User Rating: 1015    Report this Post to a Moderator | Link

quote:
Original post by McGyverDK
In OpenGL you have the function gluBuild2DMipmaps. Does the Texture class in DirectX have any methods to load data from an array into it?




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!"

 User Rating: 1183   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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?

 User Rating: 1160   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

quote:
Original post by Cipher3D
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?


Noise

-UltimaX-
Ariel Productions
|Designing A Screen Shot System|

"You wished for a white christmas... Now go shovel your wishes!"

 User Rating: 1183   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.

 User Rating: 1015    Report this Post to a Moderator | Link

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.

 User Rating: 995   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: