3d - enterra incognita - 2
3d - enterra incognita -
-
void D3D12HelloWindow::LoadAssets()
{
//...
Vertex triangleVertices[] =
//1st triangle
{ { 0.0f, 0.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } },
{ { 0.0f, -0.25f * m_aspectRatio, 0.0f }, { 1.0f, 1.0f } },
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
//2nd triangle
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
{ { -0.25f, 0.0f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
{ { 0.0f, 0.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } }
//...
void D3D12HelloWindow::PopulateCommandList()
{
//...
m_commandList->DrawInstanced(6, 2, 0, 0);
. .
std::vector D3D12HelloWindow::GenerateTextureData()
.
, 2- ,
-
// Generate a simple black and white checkerboard texture.
std::vector<UINT8> D3D12HelloWindow::GenerateTextureData()
{
const UINT rowPitch = TextureWidth * TexturePixelSize;
const UINT cellPitch = rowPitch >> 3; // The width of a cell in the checkboard texture.
const UINT cellHeight = TextureWidth >> 3; // The height of a cell in the checkerboard texture.
const UINT textureSize = rowPitch * TextureHeight;
std::vector<UINT8> data(textureSize);
UINT8* pData = &data[0];
for (UINT n = 0; n < textureSize; n += TexturePixelSize)
{
UINT x = n % rowPitch;
UINT y = n / rowPitch;
UINT i = x / cellPitch;
UINT j = y / cellHeight;
if (i % 2 == j % 2)
{
pData[n] = 0x00; // R
pData[n + 1] = 0x00; // G
pData[n + 2] = 0x00; // B
pData[n + 3] = 0xff; // A
}
else
{
pData[n] = 0xff; // R
pData[n + 1] = 0xff; // G
pData[n + 2] = 0xff; // B
pData[n + 3] = 0xff; // A
}
}
return data;
}
.
.
.
.
, -
std::vector<UINT8> D3D12HelloWindow::GenerateTextureData_v3()
{
const UINT rowPitch = TextureWidth * TexturePixelSize;
const UINT cellPitch = rowPitch >> 3; // The width of a cell in the checkboard texture.
const UINT cellHeight = TextureWidth >> 3; // The height of a cell in the checkerboard texture.
const UINT textureSize = rowPitch * TextureHeight;
std::vector<UINT8> data(textureSize);
UINT8* pData = &data[0];
UINT color = 0;
BYTE color_r = 0;
BYTE color_g = 0;
BYTE color_b = 0;
for (UINT n = 0; n < textureSize; n += TexturePixelSize)
{
pData[n] = color_r; // R
pData[n + 1] = color_g; // G
pData[n + 2] = color_b; // B
pData[n + 3] = 0xff; // A
color++;
if (color > (255 * 255 * 255))
color = 0;
color_r = 0xff;
color_g = color & 255;
color_b = 0x00;
}
return data;
}
, ,
.
2 -
// Create the vertex buffer.
{
// Define the geometry for a triangle.
Vertex triangleVertices[] =
{
//1st triangle
{ { 0.0f, 0.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } },
{ { 0.0f, -0.25f * m_aspectRatio, 0.0f }, { 1.0f, 1.0f } },
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
//2nd triangle
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
{ { -0.25f, 0.0f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
{ { 0.0f, 0.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } }
};
2 , 2 -
// Create the vertex buffer.
{
// Define the geometry for a triangle.
Vertex triangleVertices[] =
{
//1st triangle
{ { 0.0f, 0.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } },
{ { 0.0f, -0.25f * m_aspectRatio, 0.0f }, { 1.0f, 1.0f } },
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
//2nd triangle
{ { -0.25f, -0.25f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } },
{ { -0.25f, 0.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } },
{ { 0.0f, 0.0f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } }
};
-
// Create the vertex buffer.
{
// Define the geometry for a triangle.
Vertex triangleVertices[] =
{
//full rect
//1st triangle
{ { 1.0f, 1.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } },
{ { 1.0f, -1.0f * m_aspectRatio, 0.0f }, { 1.0f, 1.0f } },
{ { -1.0f, -1.0f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
//2nd triangle
{ { -1.0f, -1.0f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
{ { -1.0f, 1.0f * m_aspectRatio, 0.0f }, { 0.0f, 1.0f } },
{ { 1.0f, 1.0f * m_aspectRatio, 0.0f }, { 1.0f, 0.0f } }
};
-
// Note: using upload heaps to transfer static data like vert buffers is not
// recommended. Every time the GPU needs it, the upload heap will be marshalled
// over. Please read up on Default Heap usage. An upload heap is used here for
// code simplicity and because there are very few verts to actually transfer.
. . , ,
GPU .
...
.
:
0

0

|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
, , 2020 - ,
|
|
|
|
|
|
|
|
|
|
, , , .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3), (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(3), (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,
|
 anova
|
 A Knots Story |
 sabotage |
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
, ,
|
|
|
|
|
|
|
, ,
|
|
|
|
|
|
|
, , cms,
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
, , ria xxl , fly snow 3d , . -
|
|
|
|
|
|
fle game engine -
|
|
|
|
|
|
- / megainformatic cms express files -
|
|
|
|
|
|
Flash, Flash - .
|
|
|
|
|
|
(multi lang), , . - (megainformatic cms social), megainformatic cms groupon, keywords gen + , .
megainformatic.ru/webjob/ -
- |
|
|
megainformatic.ru/webjob/
megainformatic.ru/webjob/ -
- |
|
|
|
|
|
,
megainformatic cms admin -
|
|
|
|
|
|
350 . |
5800 . |
3000 . |
500 . |
|
|
|
|
|
|
|
|
|
|
|
|
megainformatic cms free - Photoshop
,
Adobe Photoshop. ,
- GIMP, Corel Photo Paint .
|
|
|
|
|
|
2d 3d, , !
. ,
,
!!! ( , ! ). |
|
|
|
|
|
|
|
|
|
|
|
,
: -
350 . |
510 . |
fle game engine |
|
- , ,
, .
- - :
- |
|
|
|
|
|
|
|
|
|
|
|
, 3ds max, photoshop, c++,
directx, delphi php.
,
.
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Photoshop free,
delphi directx - , !,
mp3 - ,
megainformatic cms express -
php + my sql. |
|
|
|
|
|
|
|
|
|
|
|
,
, delphi directx 8.1 (
3d ), 3d studio max, -
Fruity Loops Studio |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|