• 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
lomateron

WHAAAATT!

6 posts in this topic

While creating and evolving my program and knowledge, i came to get stuck again by the common brain errors of my self, writing something without sense for a machine. So I have to go again and starte to resolve my error by trying to spot that place where my brain failed in the code, or my code failed in the brain... . Maybe 2 complete days passed trying to find that spot-that error, passing again and again throug all my code, doing another complete simpler program solely to spot the problem, and finally spotting it i came to this very rare simple thing. In a vertex shader method, this:
PS VS( VS input )
{
PS output = (PS)0;
output.Pos = input.Pos; //----> position=float4(5.0f,5.0f,5.0f,5.0f) or whatever value
output.Tex = input.Tex;
return output;
}

is completely different form this

PS VS( VS input )
{
PS output = (PS)0;
output.Pos = float4(5.0f,5.0f,5.0f,5.0f); //----> or whatever value
output.Tex = input.Tex;
return output;
}

the first method works, the second nop, WTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF!!!!!!!!!!!!!!!!!!!!!!!!!
0

Share this post


Link to post
Share on other sites
The w-coordinate of the position is used to indicate if the position should be treated as a position or a vector and should be either 1 or 0 respectively.

Your position value is incorrect. It most likely should be float4(5.0f, 5.0f, 5.0f, 1.0f)
1

Share this post


Link to post
Share on other sites
no man when i say it doesnt works is that the value doesnt pass. Is not because the way i am using the vaule, is the line that doesnt works. it doent matter what vaule i use in the w coordinate the line will not work. ANd it never says somewhere that there is an error, it jusnt doesnt works.
0

Share this post


Link to post
I think it has to do with the fact that to represent a point or vector in 3d space, you need 3 coordinates, and to transform those coordinates using rotations, etc you multiply it against an appropriate matrix. A 3x1 Vector multiplied by a 3x3 Matrix will give you another 3x1 vector, representing the transformed point.

The issue is that a 3x3 Matrix can represent rotation and scaling, but can't include translation. To do that we need to use a 4x4 matrix. But in order for that to work, our original 3x1 point needs to be expanded to 4x1, since you can't multiply a 3x1 vector by a 4x4 matrix. The new coordinate, w, controls if the translation part of the 4x4 matrix is added to the result, so under most circumstances you want it to have a value of 1.0. However, if you're transforming a vector instead of a point, you don't want the translation applied, since a vector is an offset from 0,0,0 and the translation will change the vector's direction and magnitude, so you can use the same transformation matrix as before, but set the w coordinate of the vector to be 0.

I think that ordinarily, Direct3D takes care of adding that w=1.0f term automatically when it expands from a float3 to a float4, so when you use input.Pos, the value would be correct.

I don't fully understand the thing myself, but my explanation makes sense to me. [b]Doesn't mean it's correct though.[/b] Maybe someone more knowledgeable like MJP can chime in and correct me if I'm wrong?
1

Share this post


Link to post
Share on other sites
That is correct. The 0 W is meant to cancel out any translations a 4×X matrix would do on a 1×4 matrix (a vector) (or an X×4 and 4×1).
And when implicitly adding a 4th component to a vector it is set to 1. All other implicitly added components are set to 0.


L. Spiro
0

Share this post


Link to post
Share on other sites
You might be able to find more information on [url=http://en.wikipedia.org/wiki/Homogeneous_coordinates]homogeneous coordinates[/url] at Wikipedia ...
0

Share this post


Link to post
Share on other sites
mmm ok, i knew that, someway i ignored it when i was learning it(on tutorials), that is one of the simplest things we start learning in directx.
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