• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
ArcticHammer

Intel Atom / GMA 3650, HLSL object coords to screen fails

6 posts in this topic

I'm pulling my hair off with one specific hardware. huh.png This is an Acer Iconia w3-810 tablet, with Windows 8,  Intel Atom Z2760, and GMA "GPU".  

 

Newest driver pack has been installed. 

 

I'm developing with DirectX9 and HLSL. Some objects I render with  DirectX 9 pipeline but some objects requiring advanced coloring render with HLSL vertex and pixel shaders. The problem is coordinate conversion in the HLSL, from object space to screen coords. I suspect this must be some kind of floating point accuracy thing. 

 

In vertex shader, this works with all other computers: 

vout.Pos_ps = mul(position, WorldViewProjection);   //WorldViewProjection has all transformations 

 

[attachment=18188:amd.jpg]

 

It's taken with AMD GPU, this is all OK. 

 

But compare it to Atom's screenshot: 

[attachment=18189:spectrogram_iconia.jpg]

 

All other objects are in place, but not the one  I render with HLSL, the colorful spectrogram surface.

 

 

If I convert the coordinates in CPU side with WorldViewProjection matrix, and don't convert it all in GPU side, it renders OK with Atom too. But the matrix multiplication has to be done as follows: 

 

Vector3 TransformCoordinate( Vector3 coord, Matrix transform )
   {
   Vector4 vector;


   vector.X = (((coord.X * transform.M11) + (coord.Y * transform.M21)) + (coord.Z * transform.M31)) + transform.M41;
   vector.Y = (((coord.X * transform.M12) + (coord.Y * transform.M22)) + (coord.Z * transform.M32)) + transform.M42;
   vector.Z = (((coord.X * transform.M13) + (coord.Y * transform.M23)) + (coord.Z * transform.M33)) + transform.M43;
   vector.W = 1.0f / ((((coord.X * transform.M14) + (coord.Y * transform.M24)) + (coord.Z * transform.M34)) + transform.M44);


            Vector3 v3 = new Vector3(vector.X * vector.W, vector.Y * vector.W, vector.Z * vector.W );
            return v3; 
   }
which is in fact similar to SlimDx's Vector3.TransformCoordinate method. 

 

Then I tried to implement the similar coordinate conversion in HLSL:

 

vout.Pos_ps = TransformCoord(position);



float4 TransformCoord(float4 pos)
{
float4 tr; 


tr.x = (((pos.x * WorldViewProjection._11) + (pos.y * WorldViewProjection._21)) + (pos.z * WorldViewProjection._31)) + WorldViewProjection._41;
tr.y = (((pos.x * WorldViewProjection._12) + (pos.y * WorldViewProjection._22)) + (pos.z * WorldViewProjection._32)) + WorldViewProjection._42;
tr.z = (((pos.x * WorldViewProjection._13) + (pos.y * WorldViewProjection._23)) + (pos.z * WorldViewProjection._33)) + WorldViewProjection._43;
tr.w = 1.0f / ((((pos.x * WorldViewProjection._14) + (pos.y * WorldViewProjection._24)) + (pos.z * WorldViewProjection._34)) + WorldViewProjection._44);


return float4 (tr.x * tr.w, tr.y * tr.w, tr.z * tr.w, 1.0f); 
}

Well, it works fine with other computers, but with Atom it doesn't. The result is even worse than mul(vector, matrix) I used originally, the transformed coordinates are typically in the center of the screen in tip of the needle size, but badly warped. 

 

I really don't want to move all coordinate conversions to CPU side, that would be a massive task as we have so many different data visualization stuff implemented. 

 

What am I missing? Is there any way to improve floating point accuracy on this this machine? Should I forward resolving of this case to Intel?wacko.png  

 

 

0

Share this post


Link to post
Share on other sites

If you run your code with the reference rasterizer, does it render correctly?  It could be that you are performing some operation that is allowed to fail gracefully by most drivers, but the Intel one is more strict in its implementation.

 

If you think the transformation is the issue, you should be able to try out some other sample code on that GPU and see if there is a similar issue.  Are the DirectX SDK samples running ok on that hardware?  Also, have you tried to use PIX/Graphics Debugger to figure out what is going on inside your shaders?

0

Share this post


Link to post
Share on other sites

It renders correctly with the reference rasterizer. HLSL transformations all work correctly. But not with hardware driver. 

 

I'm contacting Intel.

0

Share this post


Link to post
Share on other sites

Have you tried creating the device with D3DCREATE_SOFTWARE_VERTEXPROCESSING instead of D3DCREATE_HARDWARE_VERTEXPROCESSING? I remember some Intel cards having problems with the latter.

0

Share this post


Link to post
Share on other sites

Have you tried creating the device with D3DCREATE_SOFTWARE_VERTEXPROCESSING instead of D3DCREATE_HARDWARE_VERTEXPROCESSING? I remember some Intel cards having problems with the latter.

 

this, since early atom CPUs had old IGPs...

 

It renders correctly with the reference rasterizer. HLSL transformations all work correctly. But not with hardware driver. 

 

I'm contacting Intel.

Try also to disable the driver optimization in the intel graphic control panel

Edited by Alessio1989
0

Share this post


Link to post
Share on other sites

A quick search says this isn't really an Intel GPU at all. It's a Power VR SGX545.

 

What are the actual values in the WorldViewProjection matrix?

 

Have you tried passing w through as normal out of the vertex shader like this?

float4 TransformCoord(float4 pos)
{
float4 tr; 

tr.x = (((pos.x * WorldViewProjection._11) + (pos.y * WorldViewProjection._21)) + (pos.z * WorldViewProjection._31)) + WorldViewProjection._41;
tr.y = (((pos.x * WorldViewProjection._12) + (pos.y * WorldViewProjection._22)) + (pos.z * WorldViewProjection._32)) + WorldViewProjection._42;
tr.z = (((pos.x * WorldViewProjection._13) + (pos.y * WorldViewProjection._23)) + (pos.z * WorldViewProjection._33)) + WorldViewProjection._43;
tr.w = (((pos.x * WorldViewProjection._14) + (pos.y * WorldViewProjection._24)) + (pos.z * WorldViewProjection._34)) + WorldViewProjection._44;

return tr;
}
0

Share this post


Link to post
Share on other sites

 

Have you tried creating the device with D3DCREATE_SOFTWARE_VERTEXPROCESSING instead of D3DCREATE_HARDWARE_VERTEXPROCESSING? I remember some Intel cards having problems with the latter.

 

this, since early atom CPUs had old IGPs...

 

It renders correctly with the reference rasterizer. HLSL transformations all work correctly. But not with hardware driver. 

 

I'm contacting Intel.

Try also to disable the driver optimization in the intel graphic control panel

 

 

Thanks for trying to help me. 

 

Setting software vertex processing instead of hardware vertex processing doesn't help. 

 

This Intel graphics control panel doesn't allow changing any settings, it just shows info. This clearly a stripped-down version of the intel grahics control panel found in laptops. 

[attachment=18245:intel_settings.png]

 

 

A quick search says this isn't really an Intel GPU at all. It's a Power VR SGX545.

 

 

GPU-Z shows "Intel(R) Grpahics Media Accelerator" as the name of the GPU. It may be Power VR inside, but is Intel GMA to the DirectX and to me. 

[attachment=18244:GPUZ.png]

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0