Jump to content

  • Log In with Google      Sign In   
  • Create Account

Martin Perry

Member Since 23 Feb 2012
Offline Last Active Jul 06 2016 09:13 AM

#5256228 Tangent space - Lengyel vs ShaderX5 - difference ?

Posted by on 08 October 2015 - 10:07 AM

I have been studiing tangent space calculations and came across two solutions


E. Lengyel - http://www.terathon.com/code/tangent.html

ShaderX5 solution - (solution is also desribed here http://www.thetenthplanet.de/archives/1180)


What is the difference between tangent computed one or another way? Lengyel solution seems "easier" but I am no quite sure of its orthogonality to the normal vector of the tangent plane.

#5190883 Isometric game and 2D or 3D characters

Posted by on 03 November 2014 - 05:34 AM

I have hand-painted, cartoon like graphics. Conversion to the mesh would be more complicated than draw a set of animation sprites. So I guess, its not really worth it.

#5107646 glCompressedTexImage3D and GL_INVALID_OPERATION

Posted by on 07 November 2013 - 04:45 AM

I have figured it. I messed up format


instead of 




, there should be



#4958830 PhysX tutorials

Posted by on 13 July 2012 - 10:06 AM

I found PhysX 3.x related simple tutorial: http://mmmovania.blogspot.cz/2011/05/simple-bouncing-box-physx3.html .. if it helps someone :)

#4956680 PhysX tutorials

Posted by on 07 July 2012 - 11:38 AM

I started with PhysX 3.x month ago.. documentation a getting started document are perfect, but its not tutorial in a way "lets do this". Tutorial would be better... but I looked and found nothing. For some purposes, 2.8 tutorial can be used... but SDK has changed significantly since.
Some useful links (but for PhysX 2.x)

Second problem for me are samples, that are very poor compred with eg. graphics samples provided by NVidia or Microsoft.
Anyway.. before PhysX i tried Bullet (the worst API i have ever seen... no doc, no comments in code... ) and ODE... PhysX is the best for me from those APIs.

#4956461 LOD Terrain - Indices management

Posted by on 06 July 2012 - 02:43 PM

I am using Quad based LOD... Drawing every block independently....merging it into one VB / IB is waste of time and it will be probably slower than multiple draw-calls.
I have had stitching done, so it looks like this
Posted ImagePosted Image

All is done by only working with IB. Can stitch any LOD quality on any other. Stitsching is computed every time scene changed, for discarding invisible (or out of frustrum blocks) is used quad-tree. Works fine, but for large terrain its not quite good in performance and calculating stitsching in real-time slow thing down... precalculation could be solution, but than it wouldn´t be so universal (conect every LOD on any other... and fro your 12 qualities even impossible).
So I switch to skirts, which are far better. I even have geo-morphing with that and everything looks fine. Basicly speaking.. stitching really disapoint me Posted Image in way of "quality vs. spend time and performance"

#4955910 LOD Terrain - Indices management

Posted by on 05 July 2012 - 03:50 AM

I tried to do stitching once... but i figured out, that skirts are better, faster and easier... thats for start :)
Now...why you need to remove duplicated vertices ? I would just send all vertices in one VB and not to bother change this VB... he will be sitting on GPU all the time unchanged. Than you will be changing only IB, which is faster and more elegant.
I have created 1 IB for every block and every LOD of this block ... gives me lot of IB... when rendering, i simply switching IB and render parts of terrain with different LOD.

Set VB
Render block 1 (IB_Lod0)
Render block 2 (IB_Lod1)

If you wan to spare switching buffers, you can generate new one and send new one every time when LOD displacement changes. Depends on your terrain size, but due to my tests and results for terrain above 512x512 it starts to be rendering brake.

#4954804 DirectX Render to Texture problem

Posted by on 02 July 2012 - 12:53 AM

Do you have correct TEXCOORDs ? Also try to turn off DepthBuffer and DepthWrites.

I am setting my full screen quad this way:
float startX = -1;
float startY = -1;
float endX = 1;
float endY = 1;

MyMath::Vector3 vecA = MyMath::Vector3(startX, startY, 0);
MyMath::Vector3 vecB = MyMath::Vector3(endX  , startY, 0);
MyMath::Vector3 vecC = MyMath::Vector3(startX, endY, 0);
MyMath::Vector3 vecD = MyMath::Vector3(endX  , endY, 0);

std::vector<QuadVertex> pos;
QuadVertex a = {vecA.X, vecA.Y, vecA.Z, 0, 1, 0};
QuadVertex b = {vecB.X, vecB.Y, vecB.Z, 1, 1, 1};
QuadVertex c = {vecC.X, vecC.Y, vecC.Z, 0, 0, 3};
QuadVertex d = {vecD.X, vecD.Y, vecD.Z, 1, 0, 2};

std::vector<short> ind;
ind.push_back(0); ind.push_back(1); ind.push_back(2);
ind.push_back(2); ind.push_back(1); ind.push_back(3);

#4923953 [Solved] C++ timer library and Compute Shaders

Posted by on 21 March 2012 - 09:22 AM

OK.. I solved it.. I used DX Query profiling...