Jump to content

  • Log In with Google      Sign In   
  • Create Account

Zaoshi Kaba

Member Since 04 Nov 2012
Online Last Active Today, 09:50 AM

#5079939 Nothing is drawn

Posted by Zaoshi Kaba on 23 July 2013 - 01:51 PM

Vertex shader looks alright, but just to be sure define cbuffer like this:

cbuffer cbPerObject : register(b0)

I cannot remember multiplication order, it might be that you need to multiply matrix*vector instead of vector*matrix, or transpose your matrices before putting them into constant buffer.


Can we see your pixel shader? However considering how you pass color from vertex shader there's probably no issues.


I cannot see where you set your render targets, are you using any depth buffer?


I would be nice to see input layout definition, data for your vertex and index buffers.



Ultimately to find problems on your own you can use:

  1. Debugger, it should throw messages if some parameters are invalid
  2. PIX or Visual Studio 2012 graphical debugger, it'll allow to see how your vertices are transformed and which pixel are drawn or discarded.

#5077890 Multi texturing shader tips needed

Posted by Zaoshi Kaba on 15 July 2013 - 10:21 AM

Yes, take a look at constant buffers.

#5077104 Shader sampling from wrong texture? [fixed]

Posted by Zaoshi Kaba on 12 July 2013 - 09:34 AM

You don't define which texture goes into which register, compiler might've removed unused variables and uses wrong register.

You probably want

Texture2D ColourMap : register(t0);
Texture2D NormalMap : register(t1);
Texture2D DepthMap : register(t2);

#5074685 Image Upscaling/Upsampling Algorithms

Posted by Zaoshi Kaba on 02 July 2013 - 03:41 AM

Awhile ago I found hq4x:


#5073761 Display Quad in top left corner.

Posted by Zaoshi Kaba on 28 June 2013 - 09:13 PM

You don't really need view matrix to render 2D image on screen.

Try to take a look at this tutorial, which is specifically made to render 2D things on the screen, not 3D space.

It should explain how to position things on the screen, and you should be able to easily see where's your mistake.

#5073145 Assimp loading model

Posted by Zaoshi Kaba on 26 June 2013 - 11:49 PM

Did you count in all vertices? They might be split into several meshes.

There's also chance of duplicate vertices (depends on your exporter), Assimp removes duplicate vertices.

#5073054 Assimp loading model

Posted by Zaoshi Kaba on 26 June 2013 - 02:35 PM

What do you mean? You actually have 24 vertices.

If you want to have only 8 you need to define normals for vertices, not triangles, however your model won't be shaded correctly (in this case).

#5073033 Assimp loading model

Posted by Zaoshi Kaba on 26 June 2013 - 01:03 PM

Does MeshNormals define normals for each triangle? If yes, then you simply have vertices that have same position, but different normal. Therefore 6 faces, each 4 vertices = 24.

#5072711 Anyone can help with this?

Posted by Zaoshi Kaba on 25 June 2013 - 04:37 AM

  1. Do you know how to use TCP? You could send HTTP request manually and receive file.
  2. Use URLDownloadToFilefunction, then open file normally.

#5071512 Strange shader behaviour

Posted by Zaoshi Kaba on 20 June 2013 - 11:32 AM

Line 271 in Graphics.cpp: this->dev->CreateInputLayout(ied, 2, VS->GetBufferPointer(), VS->GetBufferSize(), &this->pLayout);

You have 3 elements, but create only 2 of them, that shouldn't cause your crash, but you'll get incorrect rendering result, with blending it might make quads invisible.

#5071201 [SDL2] A (yet another) simple Pong clone to review

Posted by Zaoshi Kaba on 19 June 2013 - 01:22 PM

Your Game class contains std::vector<Particle> particles; which I feel is out-of-place. Imagine you'd want to have main menu with particles - you would have to create another vector<> in other class, yet again make same rendering loop & so on. Consider moving creating class such as ParticleSystem or something similar, so that it would simulate and render all particles.

#5069194 java applet flickering

Posted by Zaoshi Kaba on 12 June 2013 - 01:01 PM

No, it's right. Google double buffering, it'll fix your issue.

#5066177 Mutex creation in multithreaded library

Posted by Zaoshi Kaba on 30 May 2013 - 10:59 AM

Doesn't it get called only once, when you load library? So just load it before creating any threads.

#5065202 Animating ASSIMP models

Posted by Zaoshi Kaba on 27 May 2013 - 04:39 AM

I tried to compare to my code and I couldn't find where you use offset matrix.


My bone matrices are calculated like this:

transform = parent.transform * Matrix(interpolated_rotation, interpolated_translate) * offset;

#5065009 Animating ASSIMP models

Posted by Zaoshi Kaba on 26 May 2013 - 10:51 AM

  1. Are you sure wxyz is the right order? Usually it's xyzw.
    Quaternion(rotationKey->mValue.w, rotationKey->mValue.x, rotationKey->mValue.y, rotationKey->mValue.z);
  2. Have you tried to set deltaTime = 0, so that it doesn't actually do any interpolation. Do you get correct results?
  3. It seems you're using loop instead of recursion, are you sure parent's transform gets evaluated before children's?
  4. Do you multiply matrices in correct order?
  5. Are you sure it's not an issue with sending matrices to your shader?