3 Copyright (C) 2021 Liso <anlismon@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "shadowsScreenQuad.h"
22 shadowScreenQuad::shadowScreenQuad()
24 Material.Wireframe = false;
25 Material.Lighting = false;
27 video::SColor color(0x0);
28 Vertices[0] = video::S3DVertex(
29 -1.0f, -1.0f, 0.0f, 0, 0, 1, color, 0.0f, 1.0f);
30 Vertices[1] = video::S3DVertex(
31 -1.0f, 1.0f, 0.0f, 0, 0, 1, color, 0.0f, 0.0f);
32 Vertices[2] = video::S3DVertex(
33 1.0f, 1.0f, 0.0f, 0, 0, 1, color, 1.0f, 0.0f);
34 Vertices[3] = video::S3DVertex(
35 1.0f, -1.0f, 0.0f, 0, 0, 1, color, 1.0f, 1.0f);
36 Vertices[4] = video::S3DVertex(
37 -1.0f, -1.0f, 0.0f, 0, 0, 1, color, 0.0f, 1.0f);
38 Vertices[5] = video::S3DVertex(
39 1.0f, 1.0f, 0.0f, 0, 0, 1, color, 1.0f, 0.0f);
42 void shadowScreenQuad::render(video::IVideoDriver *driver)
44 u16 indices[6] = {0, 1, 2, 3, 4, 5};
45 driver->setMaterial(Material);
46 driver->setTransform(video::ETS_WORLD, core::matrix4());
47 driver->drawIndexedTriangleList(&Vertices[0], 6, &indices[0], 2);
50 void shadowScreenQuadCB::OnSetConstants(
51 video::IMaterialRendererServices *services, s32 userData)
54 services->setPixelShaderConstant(
55 services->getPixelShaderConstantID("ShadowMapClientMap"),
59 services->setPixelShaderConstant(
60 services->getPixelShaderConstantID("ShadowMapClientMapTraslucent"),
64 services->setPixelShaderConstant(
65 services->getPixelShaderConstantID("ShadowMapSamplerdynamic"),