Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Jul 2010
Offline Last Active Sep 25 2012 07:56 AM

Topics I've Started

Direct3D 9 - NVidia works, ATI fails

19 September 2012 - 07:33 AM

Hi everyone,

Last week, I developed a small rendering task for a technical test (I won't say the company name neither the complete topic, for confidential reasons).

I finished the test in time, but for a strange reason it perfeclty works on NVidia hardware, but not on ATI hardware. The rendering is done in a right-handed environment, because it must be compatible with both Direct3D and OpenGL.

I tried to have a look at PIX, and all is fine (index buffers, streams, textures, shaders, render state...). The vertex shader works well (tried to look at the different steps of a single mesh rendering), but the rasterizer seems to discard all the triangles, and it seems that the pixel shader is never called (if I right click a pixel and select "debug this pixel", I have nothing excepted the "clear" pixel setting). Sometimes, I read "this pixel has been discarded for the following reason : did not pass the alpha test", but there is no vertex shader/pixel shader to debug. Also, the alpha test is set to false, and the func is set to "always" !

Is there something I missed in the process ?

If you need more info that can help me solve the problem, just ask me for them and I'll give you what you need Posted Image

Thanks in advance Posted Image


(PS : the D3D9 debug mode tells me that the ATI driver does not support index buffers ("(info) : failed to create driver index buffer"), so I tried primitive rendering without indices but it still draws nothing. Trying to update my ATI driver brought me to a blue screen)

normal mapping issue

03 December 2010 - 01:42 AM

Hi everyone.

I'm working on a simple shader to make a normal mapping effect to use with the graphics engine I'm currently on.

This shader computes lighting that comes from a single point light (with att and a single diffuse color). The material is composed of a diffuse texture, a specular map and a normal map (the famous "blue map").

The shader seems top work, but only approximately.

I got an issue with the specular lighting that behaves in a verry weired way.

So I wish to know if my theory of the normal mapping is correct :

- In VShader, send as output the transformed position, the local position, the tangent, binormal and normal values, and the texture coordinates
- In PShader, create a vector from local pos to local light pos, transform it using TBN (from values we get of the VShader) and normalize it. Idem for the vector from local pos to camera pos. Then, compute Halfway vector by adding the two first vectors and then normalize. Sample normal map using texture coordinate off from the rasterizer (normalizing is not necessaray?). Compute lighting using sampled normal and transformed/normalized vectors (with lit function).

Compute color using diffuse and specular map, and draw pixel.

To get the normal from the normal map, we have to do like this :
(Tex2D(map_normal, In.uv) - 0.5f) * 2.0f

Is that all right? I send you the shader when I come back home this evening (I'm GMT+1 here, so in the afternoon for US people)

Thanks in advance.


multi-screen rendering

26 July 2010 - 08:11 AM

Hi everyone :)

It's my first post here, and I'm glad to enter in this community (and also hope my English will be understandable '^^)

Here is my problem : since last year, I followed a course about graphics programming, and especially about direct3D. I become familiar to this library now, and wish to try something new. A new screen is about to arrive in a few days, and I want to do a small multi-monitor rendering technical demo.

But the problem is, if I remember well, we have to choose an adapter when creating a device. I think then I'll have to instantiate more than one device for the purpose I'm targeting. The questions are :

Do I really need to instantiate different devices?
If not, how can I do?
If yes, How can I render a full single scene on multiple monitors? Do I have to do multiple renders steps with different view matrices, or may I render in a big render target surface and then draw on all monitors?

I thank you all in advance for your tips :)