Direct3D11 Engine/source changes

This commit is contained in:
rextimmy 2016-03-20 21:52:11 +10:00
parent 3a9b50f702
commit 41e5caf22b
81 changed files with 1291 additions and 617 deletions

View file

@ -1315,7 +1315,7 @@ DefineEngineMethod( EditTSCtrl, renderCircle, void, ( Point3F pos, Point3F norma
{
PrimBuild::color( object->mConsoleFillColor );
PrimBuild::begin( GFXTriangleFan, points.size() + 2 );
PrimBuild::begin( GFXTriangleStrip, points.size() + 2 );
// Center point
PrimBuild::vertex3fv( pos );

View file

@ -1403,7 +1403,7 @@ void Gizmo::renderGizmo(const MatrixF &cameraTransform, F32 cameraFOV )
for(U32 j = 0; j < 6; j++)
{
PrimBuild::begin( GFXTriangleFan, 4 );
PrimBuild::begin( GFXTriangleStrip, 4 );
PrimBuild::vertex3fv( sgCenterBoxPnts[sgBoxVerts[j][0]] * tipScale);
PrimBuild::vertex3fv( sgCenterBoxPnts[sgBoxVerts[j][1]] * tipScale);
@ -1599,7 +1599,7 @@ void Gizmo::_renderAxisBoxes()
for(U32 j = 0; j < 6; j++)
{
PrimBuild::begin( GFXTriangleFan, 4 );
PrimBuild::begin( GFXTriangleStrip, 4 );
PrimBuild::vertex3fv( sgCenterBoxPnts[sgBoxVerts[j][0]] * tipScale + sgAxisVectors[axisIdx] * pos );
PrimBuild::vertex3fv( sgCenterBoxPnts[sgBoxVerts[j][1]] * tipScale + sgAxisVectors[axisIdx] * pos );
@ -1663,7 +1663,7 @@ void Gizmo::_renderAxisCircles()
ColorI color = mProfile->inActiveColor;
color.alpha = 100;
PrimBuild::color( color );
PrimBuild::begin( GFXTriangleFan, segments+2 );
PrimBuild::begin( GFXTriangleStrip, segments+2 );
PrimBuild::vertex3fv( Point3F(0,0,0) );

View file

@ -265,18 +265,18 @@ void GuiTerrPreviewCtrl::onRender(Point2I offset, const RectI &updateRect)
// the texture if flipped horz to reflect how the terrain is really drawn
PrimBuild::color3f(1.0f, 1.0f, 1.0f);
PrimBuild::begin(GFXTriangleFan, 4);
PrimBuild::texCoord2f(textureP1.x, textureP2.y);
PrimBuild::vertex2f(screenP1.x, screenP2.y); // left bottom
PrimBuild::begin(GFXTriangleStrip, 4);
PrimBuild::texCoord2f(textureP1.x, textureP1.y);
PrimBuild::vertex2f(screenP1.x, screenP1.y); // left top
PrimBuild::texCoord2f(textureP2.x, textureP2.y);
PrimBuild::vertex2f(screenP2.x, screenP2.y); // right bottom
PrimBuild::texCoord2f(textureP2.x, textureP1.y);
PrimBuild::vertex2f(screenP2.x, screenP1.y); // right top
PrimBuild::texCoord2f(textureP2.x, textureP1.y);
PrimBuild::vertex2f(screenP2.x, screenP1.y); // right top
PrimBuild::texCoord2f(textureP1.x, textureP1.y);
PrimBuild::vertex2f(screenP1.x, screenP1.y); // left top
PrimBuild::texCoord2f(textureP1.x, textureP2.y);
PrimBuild::vertex2f(screenP1.x, screenP2.y); // left bottom
PrimBuild::texCoord2f(textureP2.x, textureP2.y);
PrimBuild::vertex2f(screenP2.x, screenP2.y); // right bottom
PrimBuild::end();
}
}

View file

@ -658,7 +658,7 @@ void SelectionBrush::rebuild()
//... move the selection
}
void SelectionBrush::render(Vector<GFXVertexPC> & vertexBuffer, S32 & verts, S32 & elems, S32 & prims, const ColorF & inColorFull, const ColorF & inColorNone, const ColorF & outColorFull, const ColorF & outColorNone) const
void SelectionBrush::render(Vector<GFXVertexPCT> & vertexBuffer, S32 & verts, S32 & elems, S32 & prims, const ColorF & inColorFull, const ColorF & inColorNone, const ColorF & outColorFull, const ColorF & outColorNone) const
{
//... render the selection
}
@ -1342,8 +1342,8 @@ void TerrainEditor::renderPoints( const Vector<GFXVertexPCT> &pointList )
U32 vertsThisDrawCall = getMin( (U32)vertsLeft, (U32)MAX_DYNAMIC_VERTS );
vertsLeft -= vertsThisDrawCall;
GFXVertexBufferHandle<GFXVertexPC> vbuff( GFX, vertsThisDrawCall, GFXBufferTypeVolatile );
GFXVertexPC *vert = vbuff.lock();
GFXVertexBufferHandle<GFXVertexPCT> vbuff( GFX, vertsThisDrawCall, GFXBufferTypeVolatile );
GFXVertexPCT *vert = vbuff.lock();
const U32 loops = vertsThisDrawCall / 6;
@ -1394,7 +1394,7 @@ void TerrainEditor::renderSelection( const Selection & sel, const ColorF & inCol
if(sel.size() == 0)
return;
Vector<GFXVertexPC> vertexBuffer;
Vector<GFXVertexPCT> vertexBuffer;
ColorF color;
ColorI iColor;
@ -1430,15 +1430,15 @@ void TerrainEditor::renderSelection( const Selection & sel, const ColorF & inCol
//
iColor = color;
GFXVertexPC *verts = &(vertexBuffer[i * 5]);
GFXVertexPCT *verts = &(vertexBuffer[i * 5]);
verts[0].point = wPos + Point3F(-squareSize, -squareSize, 0);
verts[0].point = wPos + Point3F(-squareSize, squareSize, 0);
verts[0].color = iColor;
verts[1].point = wPos + Point3F( squareSize, -squareSize, 0);
verts[1].point = wPos + Point3F( squareSize, squareSize, 0);
verts[1].color = iColor;
verts[2].point = wPos + Point3F( squareSize, squareSize, 0);
verts[2].point = wPos + Point3F( -squareSize, -squareSize, 0);
verts[2].color = iColor;
verts[3].point = wPos + Point3F(-squareSize, squareSize, 0);
verts[3].point = wPos + Point3F( squareSize, -squareSize, 0);
verts[3].color = iColor;
verts[4].point = verts[0].point;
verts[4].color = iColor;
@ -1452,7 +1452,7 @@ void TerrainEditor::renderSelection( const Selection & sel, const ColorF & inCol
GridPoint selectedGridPoint = sel[i].mGridPoint;
Point2I gPos = selectedGridPoint.gridPos;
GFXVertexPC *verts = &(vertexBuffer[i * 5]);
GFXVertexPCT *verts = &(vertexBuffer[i * 5]);
bool center = gridToWorld(selectedGridPoint, verts[0].point);
gridToWorld(Point2I(gPos.x + 1, gPos.y), verts[1].point, selectedGridPoint.terrainBlock);
@ -1503,12 +1503,12 @@ void TerrainEditor::renderSelection( const Selection & sel, const ColorF & inCol
// Render this bad boy, by stuffing everything into a volatile buffer
// and rendering...
GFXVertexBufferHandle<GFXVertexPC> selectionVB(GFX, vertexBuffer.size(), GFXBufferTypeStatic);
GFXVertexBufferHandle<GFXVertexPCT> selectionVB(GFX, vertexBuffer.size(), GFXBufferTypeStatic);
selectionVB.lock(0, vertexBuffer.size());
// Copy stuff
dMemcpy((void*)&selectionVB[0], (void*)&vertexBuffer[0], sizeof(GFXVertexPC) * vertexBuffer.size());
dMemcpy((void*)&selectionVB[0], (void*)&vertexBuffer[0], sizeof(GFXVertexPCT) * vertexBuffer.size());
selectionVB.unlock();
@ -1518,7 +1518,7 @@ void TerrainEditor::renderSelection( const Selection & sel, const ColorF & inCol
if(renderFill)
for(U32 i=0; i < sel.size(); i++)
GFX->drawPrimitive( GFXTriangleFan, i*5, 4);
GFX->drawPrimitive( GFXTriangleStrip, i*5, 4);
if(renderFrame)
for(U32 i=0; i < sel.size(); i++)

View file

@ -173,7 +173,7 @@ public:
const char *getType() const { return "selection"; }
void rebuild();
void render(Vector<GFXVertexPC> & vertexBuffer, S32 & verts, S32 & elems, S32 & prims, const ColorF & inColorFull, const ColorF & inColorNone, const ColorF & outColorFull, const ColorF & outColorNone) const;
void render(Vector<GFXVertexPCT> & vertexBuffer, S32 & verts, S32 & elems, S32 & prims, const ColorF & inColorFull, const ColorF & inColorNone, const ColorF & outColorFull, const ColorF & outColorNone) const;
void setSize(const Point2I &){}
protected:

View file

@ -1303,7 +1303,7 @@ void WorldEditor::renderObjectFace(SceneObject * obj, const VectorF & normal, co
PrimBuild::color( col );
PrimBuild::begin( GFXTriangleFan, 4 );
PrimBuild::begin( GFXTriangleStrip, 4 );
for(U32 k = 0; k < 4; k++)
{
PrimBuild::vertex3f(projPnts[k].x, projPnts[k].y, projPnts[k].z);
@ -1503,7 +1503,7 @@ void WorldEditor::renderSplinePath(SimPath::Path *path)
if(vCount > 4000)
batchSize = 4000;
GFXVertexBufferHandle<GFXVertexPC> vb;
GFXVertexBufferHandle<GFXVertexPCT> vb;
vb.set(GFX, 3*batchSize, GFXBufferTypeVolatile);
void *lockPtr = vb.lock();
if(!lockPtr) return;