|
@@ -381,7 +381,7 @@ void DirectX11::initialize( WFenster *fenster, Vec2<int> backBufferSize, bool fu
|
|
|
pixelShader->erstelleConstBuffer( sizeof( float ) * 3, 1 );
|
|
|
pixelShader->erstelleConstBuffer( sizeof( int ) * 2, 2 );
|
|
|
|
|
|
- int lc[] = { 1, 0 };
|
|
|
+ int lc[] = { 0, 0 };
|
|
|
pixelShader->füllConstBuffer( (char *)lc, 2, sizeof( int ) * 2 );
|
|
|
|
|
|
|
|
@@ -475,36 +475,8 @@ void DirectX11::initialize( WFenster *fenster, Vec2<int> backBufferSize, bool fu
|
|
|
vertexBuffer = new DX11Buffer( sizeof( Vertex3D ), d3d11Device, d3d11Context, D3D11_BIND_VERTEX_BUFFER );
|
|
|
indexBuffer = new DX11Buffer( sizeof( int ), d3d11Device, d3d11Context, D3D11_BIND_INDEX_BUFFER );
|
|
|
|
|
|
- DiffuseLight dl[ 1 ];
|
|
|
- dl[ 0 ].direction = Vec3< float >( 50.f, 50.f, -500.f ).normalize();
|
|
|
- dl[ 0 ].color = Vec3<float>( 0.5f, 0.5f, 0.5f );
|
|
|
diffuseLights = new DX11StructuredBuffer( sizeof( DiffuseLight ), d3d11Device, d3d11Context );
|
|
|
- diffuseLights->setData( dl );
|
|
|
- diffuseLights->setLength( sizeof( dl ) );
|
|
|
- diffuseLights->copieren();
|
|
|
- PointLight pl[ 6 ];
|
|
|
- pl[ 0 ].position = Vec3< float >( 0, 130, 0 );
|
|
|
- pl[ 0 ].color = Vec3< float >( 1.f, 1.f, 0.f );
|
|
|
- pl[ 0 ].radius = 100;
|
|
|
- pl[ 1 ].position = Vec3< float >( 150, 130, 0 );
|
|
|
- pl[ 1 ].color = Vec3< float >( 0.f, 1.f, 0.f );
|
|
|
- pl[ 1 ].radius = 100;
|
|
|
- pl[ 2 ].position = Vec3< float >( 150, 130, 150 );
|
|
|
- pl[ 2 ].color = Vec3< float >( 0.f, 0.f, 1.f );
|
|
|
- pl[ 2 ].radius = 100;
|
|
|
- pl[ 3 ].position = Vec3< float >( -150, 130, 0 );
|
|
|
- pl[ 3 ].color = Vec3< float >( 1.f, 0.f, 1.f );
|
|
|
- pl[ 3 ].radius = 100;
|
|
|
- pl[ 4 ].position = Vec3< float >( 0, 130, 150 );
|
|
|
- pl[ 4 ].color = Vec3< float >( 0.f, 1.f, 1.f );
|
|
|
- pl[ 4 ].radius = 100;
|
|
|
- pl[ 5 ].position = Vec3< float >( -150, 130, 150 );
|
|
|
- pl[ 5 ].color = Vec3< float >( 1.f, 0.f, 0.f );
|
|
|
- pl[ 5 ].radius = 100;
|
|
|
pointLights = new DX11StructuredBuffer( sizeof( PointLight ), d3d11Device, d3d11Context );
|
|
|
- pointLights->setData( pl );
|
|
|
- pointLights->setLength( sizeof( pl ) * 6 );
|
|
|
- pointLights->copieren();
|
|
|
}
|
|
|
|
|
|
void DirectX11::update()
|
|
@@ -746,6 +718,9 @@ void DirectX11::renderKamera( Kam3D *zKamera )
|
|
|
pixelShader->füllConstBuffer( (char *)& kamPos, 0, sizeof( float ) * 3 );
|
|
|
Welt3D *w = zKamera->zWelt();
|
|
|
w->lock();
|
|
|
+ int lc[] = { w->getDiffuseLightCount(), w->getPointLightCount() };
|
|
|
+ pixelShader->füllConstBuffer( (char *)lc, 2, sizeof( int ) * 2 );
|
|
|
+ w->copyLight( diffuseLights, pointLights );
|
|
|
int alphaAnzahl = 0;
|
|
|
int maxDist = 0;
|
|
|
int minDist = 0x7FFFFFFF;
|