Thursday, June 29, 2006

Entering C# and Java

The reason for the switch

Wait...what? C# and JAVA? These two are totally not making any sense with all my previous post, I said direct X is it? Well, i ain't giving up in learning Direct X. Actually 3 ppl asked me how was my progress in DirectX today, make me shame to answer that i didnt progress for nearly 5 days. What I did was just watching drama, watching Naruto E-ComicBook, Chatting with friends, dinner with friends, Tennis with William Basketball abit with leongi, thinking of my korean Teacher ( this is just kidding...).

I think things just getting into the life in almost the same time. I have to learn C# in fast pace to meet Hatchlings Games latest game design. .Net language is the base language for the game. Well, this is a good reason for me to start getting .NET language in my dictionary. I return my Vertex shader to library and brought out another book written by Jesse Liberty about C#. I read this book before at KLCC's Kino Kuriya, and i spend like 3 hours just sitting there to read that book. I lock this book as my first book as if I going to start leaning the .NET language and MMU's library always updated with the latest book which can borrow for free and unlimitted renew (as i know... i borrow a book for 10 weeks last sems :P).

I am going to take Java this semester for the subject named Object Oriented Programming. yea, everyone think of Java when talking about OOP (i personally is C++ fans and i think C++ is a better OOP language with the pointer manipulation in C++, please fix me if i were wrong). Well, the funny thing for Java and C# syntax is....nearly 70% alike. Especially when I start this two language and almost the same time. I mean actually start learning (I learn Java at 2003 myself and C# at 2005 - 3 hours in KLCC).

(What a hot night......)

C# and Java??

Is leaning C# and Java at the same time is a good idea, I don't have the answer now. So far it's cool since the style is nearly the same for beginner stage. I not sure is these two language going to be use by me or not in the future, but no doubt these are critical langauge to learn in this time.

C# is the center of .NET language. .NET is a very awesome framework for Microsoft enviromant. Well, who not using window's OS when watching my blog? (and whose windows is original :P). The very good thing of .NET is the cross language usage. I not really sure how to name it and what actually is it. The main idea is all .NET language can actually use in a same program. Direct X can be code in .NET framework, named Managed Direct X (i hope i don't get this wrong, again). Using C++ to code Windows application is a tedius work, not much people like to use C++ to code simple windows application. This is the reason why .NET framework get famous quickly (my guess). Back to GameDev. C# is a very good language for coding simple windows base game with direct X (2d? well, this is because not willing to use any game engine and game framework), and this is why i am learning it now.

Java is a very famous cross platform language. Mobile, any PC, web are full with java application. I personally think that .NET replaced Java in PC application (Windows only...). Java still hold it ground in Mobile as i know (correct me if .NET attacking mobile too) where J2ME seem is the best language to use in handphone. SEGD going to learn J2ME at 2nd year 3rd sems which using J2ME to make some mobile game, well, looking forward for it. Kuan doesn't like Java anyway. He thinks it's not effective, high level and limitted game's coding language. I heard Kevin(Lead artit of Game Brains) said :"Some people use Java to code a Quake 3 game, run smoothly in current PC, where Quake3 actually run smoothly 5 years ago with C++ and OpenGL). *Chak* the picture.

Carry on the LiFe

Was busy with GDC thingy. Booth, meeting with comm, planning and such. Actually something really pissed me off about GDC, I don't mean the new Comm or the club. I refer to some Inactive or not involved people actually talking bad and trying to bring trouble to the club. Too many things involved and i don't think it is good to say it here. ** at this point, i deleted 2 paragraph which i typed out, but, after consideration, i deleted it. **

Not fair to talking bad about other people and I don't want to be Asshole who just know complaining and sitting there talking crapz. I never mean so hard to become GDC's comm, I don't want it in first place. The fact is, i don't want some other random people who know how to use words to decorate him/herself in the public and get the post in Hi-Comm AGAIN i mean, "again" and do shit in the club. Joining GDC was my 2nd target in joining MMU. I dont want it dead in my time in MMU. If i failed my job in GDC, i will feel shame and not just hitting the butt and say "i quit".

Open Election of Hi-Comm is a fair system to elect someone to lead the organization. Fully agree. But condition apply. The election must Vote by people who actually know each other and know everyone's strength. Mean, Vote is dedicate to people who active involve and show up for activities. Non-member or Inactive, stand aside a cry. Some "Uncle" i mention previously wanted GDC to vanish, because we stuck our leg into his asshole few times and just playing game and making noise by shaking his hi-pay salary chair. Some forbidden club action such as Intra-Election will give him the right to ban us. Yea, ITS doing intra-election as well. Ban? ahhh, wait... thats his belonging. Matha Facka...

Today Felling - Not pissing off lah, over and useless too. Tommorow is the day of "An Neong Ha Sei Yo" Cheer :P

Saturday, June 24, 2006

GDC new year and I am Vice President (Game Dev)

GDC new year

Today just had a meeting at John's house for the 1st meeting of GDC new president (Iris) and vice president - Gaming (Syefri) and me, vice presidnet (Game Dev) and sure, John also, the Founder of GDC MMU. Well, I was late to the meeting, was singing K at LowYat's RedBox. Thats an earlier appointment made with William them, so I have to be there first.

When I reach John's house, they just finish discuss about the Gaming section of the year planning. There are a lot of plans and events going to happen in this academic year. This Gamma going to be crazy. With Syef and John's dedication along witht the support of Iris and the club, i think all this are going to be happen. It's all about gaming - competition, charity play( as what i just heard of) and challenge other college thingy. This going to be great and really looking forward since last year was helping in organizing the LAN Game Competition and got really excited and interested in watching and making a game competition. It is always good to see pro gaming happen around. College-WCG is happening at MMU's MPH next next week. DOTA and CS is the games. keep an eye on it!

After the gaming section, Syef left, he has work to do tommorow. Then me, Iris and John walked to Mamak to grab some food and continue the discussion. Next thing is the topic of Game Dev part for GDC. GDC was too heavy loaded with Gaming events last semester - LGC, DnD, MTG, Live-Action RPG, etc. While GameDev related events were lesser compare to Gaming part - FGCS, Weekly meeting and...? I think this is a new strategy to counter this problem. One president, two vice to focus mainly on their own part of GDC. So GDC can grow equally and parallel in both part.

What is the thing for Game Dev going to happen in GDC. Frankly, game development is not getting much attention and interested people to join and discuss of it compare to gaming. GDC plans to have a Weekly club gathering where in the gathering will try to get some one to give some talk about game development or industry news to fellow GDC member or anyone who interested in game development. The next thing is a Art gallery which open to all by exibit in a close manner, just registered attendees and member can join. Next is Game Programming competition which focus in testing of game related algorithm testing in Lab. Then is Game design workshop which gather people interest in game design together and make a competition and discussion session. Story writing is the next thing which i announce it to all MMU's students and they can submit they story in any form to our GDC's website and vote by the mass. Last event stay the same, which is the most important event, FGCS.

What I did...

Actually the time elapsed since I stop last paragraph to this line of text is around 2 hours later. Been go to Putrajaya (kidnap by someone, ice cream as lure...).

Thursday night I went back to KL to see the fast movie - fast and furios 3, tokyo drift. Well, nice car, nice action, and hot chicks :P For car lover or drift love, this movie is recommended. No pics here, censored... lol. After that, I been to sing K at Low Yat with William, Eddie, Leongi and Alferd. Had a good time i guess, sang until sore throat. lol. ahhh....sorry, kind of VERY sleepy, cannot crap anymore :P

Tuesday, June 20, 2006

Eight Below & Game Apps I

A touching and inspiring movie -- Eight Below

Just finish the movie and I got a strong feeling that I must wrote it out here. I knew it's a bit late, this movie was release like... this start of year I think. I was wanting to watch it in cinema but seem no one interest to see this in a cinema and didnt get the chance to group some people to watch it. So i missed it. After some months, the fate drive me to Setapak, and I found this movie in Kent's computer. I copied it, bring it back to cyber and watch it in my "sweet maggie" time :P

I charmed by this movie, really. The story, the sled dogs, the act. It is so...amazing. Very brief for the story. Due to some incident, Jerry and his team force to left the 8 sled dogs in the Antartica base and cannot go back to save them for the whole winter. So these 8 sled dogs, Name Old Jack, Maya, Max, Shorty, Truman, Buck,
Shadow and Dewel left there. The second part of the movie mainly about how those dogs survive themself at Antartica, some cannot make it. And Jerry try hardly to find a way back to the dogs.



The Best thing in this movie is the sled dogs. They'
re so intelligent and cute. Dialog in this movie is less, because the dogs do not talks, at least we don't understand it. We still understand, actually feel and touch by the scene where just the sled dogs acting the scene. I kept thinking how they made the dogs act that way, thats so smart! I get to know several thing which i never learnt in my life, the life at Antartica, the toughness of sled dogs and the high bond of human and dogs. Keep to see this movie, it's so nice, it's inspiring, it's just more than human :P

Game Application I (the sad thing is....no more picture here :P )

After my previos post (so bad about Game Foundation), until today, the first day of Gamma year, I had my first class of Game Application 1. Overally, the starting of this class by Miss Isuzi and with her complete planing for the who semester lecture and tutorial is very good, and far more better impersion to everyone in class (who got the scar of Game Foundation as told). It's different from Hilmy(the founder of MMU's SEGD) GameApps 1 as told by my senior. But I think thats cool. Along with the lecturers and assignment, we'll explore to game design process step by step by the time keep designing our own game elements by elements. At the end of the class, we expected to make a simple, single player game with any platform.

Obviously this is different from game programming 1's last assignment. Game programming was focusing in programming, thats the reason I can score it well because I just code my "simple" game with some better coding and tricky coding. Anyway, I should introduce my 1st flash game from game programming 1 -- BuiltLittleHouse. GameApps1 last assignment seem a bit different from that, it's more design focused. So here to determind whether I'm a Game designer, or Game Programmer. lol.

We have to work out our idea next week, actually I got some... basic idea. Will reveled here once i got confirmed. hehe

life~?

Today played a "so long" sport...basketball. I mean, so long didn't played. Had some good time, and bad time too :P got Own by some gang of people. hehe. Well, i guess my life is plain, seem nothing to talked about...Hmmm...what the main purpose of this blog...

Yea...missing 2 post of Dx? whats going on? Well, faced some problem in it actually. I was thinking to share something out once i got myself over the problem and will discuss about it. Need to go over something from beginning again.

Today feeling ..-.. First day, Old feeling.

Friday, June 16, 2006

Game Foundation "B"? Education "F"

Idiot

Just check my result for last semester. Overally it's good but the thing is my CGPA pulled down slightly because of the subject Game Foundation. I got a B from that, and I really dissapointed with this. I personally think I don't deserve this result with the work I submitted as the final project. What is this all about?

Game Foundation is a subject EXPECTED to be teaching the game basic knowledge, game design basic, game industry and game production. Teach all basic concept to fellow new game design students. Agree? So... What actually MMU's Game Foundation NEW GAME IDIOT lecturer teach then... At the very first day, the very first thing she told to us (a bunch of full passion, freak gamer and game developing dreamer) is, she not interest in game, she force to teach us by the university. Anyone see any problem here? The University offer the course, give out a subject named Game Foundation and elect a lecturer who don't know what actually is game and don't like game to teach? Who made that stupid decision? I think is someone never read some book, or some wire in the brain was short circuited will only do that....but wait...who can made that decision, someone got a Title as DEAD....sorry...is DEAN. *pssst pssst* "hey....this Malaysia's education...."

What can we do? Just suit yourself... So we carry on our class of game foundation. The class is pathetic, what we were doing is, go into class, fill some question, past it up and start talking crap with the lecturer. She start asking like, what is RPG? how to? why? wait...the she is refering to the lecturer, and lecturer means the people who suppose to tell answer, not ask question. Ok, after 3 classes of craps, she cannot stand it, and so do we, then suddenly at the 4th class, she gave us everyone a piece of paper with half page of text (in point form). That paper consist a question "Discuss 10 Genres with game example". This is the MARK for Game Foundation. YaY, cool? Idiot! Then she announce that this is the last lecture for this subject. No more lecture for the rest of semester. cool? Super Idiot!

Okay, I knew useless to keep complaining and talking bad thing about people. Lets see what I did for the report. I aimed a High grade for this subject so I put a lot of effort in doing this report. It is 100% coursework, c'mon! So i did these, some example of my pages from the report and I got 73 pages of this. I did this report for 5 days like that.
I compiled all these pages as PDF files. Burned to CD and submitted to her. At the day I submitting, Zaki and Azwan were trying to pull some mark, they asked for extended dead line and they will print the whole report out. She allowed. What i thought? WHAT?! extended with no penalty?! Then where is my effort to rush this report while at the same time I have another 3 assignments. This nevermind, I tried my best. But she meant that if we print the whole report out, we MAY BE score a higher mark. Why?? To print this report out, I need RM50 at least. She asking me to BUY mark anyway? And i got a B now.

Well....Frankly, I dont think i made a good report for this. Some people may be already flaming me that I did those rubbish and crying that I don't get an "A". Sorry but this really my Most Beutiful and Creative thing i ever made in my life. I put 100% confident in this, thats why I'd pissed off by the B. I not actually complaining I got a "B", but my anger grow when i figure out this subject pull my CGPA down. Others I wont say a word. Just because this subject's assignment is stupid and lecture is idiot! Thats why i am yelling here!

Picture of all?

We paid RM1k++ to attend this subject. End up? A lecturer who don't know a thing of game development. An idiot assignment which just 20% related to determine the mark for 100%. No Lecture, we learn nothing, really, nothing beside the fact that MMU eat the money and put us aside with pathetic assignment and lecture. Anger, frustration, confusion, dissaipointment for game education.

Go to MMU website are see, what they promised and what we can expected from Software Engineering and Game Design course. So we end up paying huge fee to learn bad emotion and sad fact of education. Who coordinate the course? Who promised everyone that they will put their effort in educating student, planing the best for students? People who got few K of salary, driving nice car, live in nice home and sleeping in the office? People who try so hard to figure out new way to trick new student to their university to pay the school fee? People who just care about the name and title? People doing dirty trick to hold their position and kill other's right?

Don't those people who having the power but not doing they job afraid some little kid go in front and ask "Uncle, why someone like you can have that position?" "Uncle, issint your job is to take care of us, why I just saw you trying to kill us off?" "Uncle, what you promised us?" "Uncle, why i am suffering while you still got pay?"

To all my fellow Coursemates, to all my fellow University mate, to all my Country mates. We're living in what? I knew its small case to imply to a large picture like this, but, how many people who actually facing the same situation and agree with me? how many people actually study happy ever after and disagree with me? Lets guess the ratio. Here my words.

Today feeling... forget it...

Tuesday, June 13, 2006

Back to Cyber Jaya & 3D Graphic Fundamentals II

CyberJaya Once again

It's not bad thing or what, but somehow, I back to CyberJaya. There a lot of people questioning me, why are you going back to cyber one week before the school start? errr, no reason, just want to get back here. Felt something i need to settle (such as...returning my overdue library book), something to discuss (such as...Hatchlings games new game design.), someone to meet and hang our with (such as... Someone lah). So...is that no reason? okok...nonsense I knew.

I had some crazy, plain and tiring days at Setapak, Wangsa Maju is a better word now, since they moved the base to Wangsa Maju section 2. Anyway, i enjoyed it, and i guess its time for me back to cyber to start preparing myself for a new sems. Don't get me wrong, i'm not that hardworking, preparing not in the sense of study or what. Just need to clean my room, arrange the mess, make up a plan for a new sems (in Game Dev sake :P).

3D graphic pipeline II

First of all, actually I didnt finish discusing about the 3D graphic thing at previous post. It's too long to continue and too tired for me to continue typing that night, .... ya, I was lazy. hehe. (OMG its so late! i still day dreaming)

Second part I going to share the World Matrix, View Matrix and Projection Matrix which is essential in displaying something 3D on our screen. Thanks to mathematic we able to do all these very complex and mathematic heavy concept transformation in just applying the knowledge of matrix. And thanks to Direct X SDK provided us a very simple way to apply those matrix. Without them, i think 3D is a over tough subject which kill everyone off and I don't think we playing World of Warcraft now...

World Matrix. World Matrix hold the information of final transformation of that particular mesh in the 3D world. Every Mesh is start in the middle of the world aka. (0,0,0) and every vertex of it will reside following its origin (so called local coordinate). In other words, every meshed in direct x is naturally place at the center of world, until they multiply their world matrix (which mean apply all the rotation, scale and translation which represent in the world matrix) and appear at that position after all. So, world matrix is a matrix which define the final destination of one mesh and all those information will pass to next step, all apply another matrix, view matrix.

View Matrix. View matrix, also can refer as the Camera in our 3D world. View matrix will contain the position of the camera, right vector, up vector and Look at vector of the camera which representing where are our screen is actually watching at in the 3D world. I easily use a function

D3DXMatrixLookAtLH( D3DXMATRIX* pOut, CONST D3DXVECTOR3* pEye,
CONST D3DXVECTOR3* pAt, CONST D3DXVECTOR3* pUp);

This function help us easy define all necessary vector and apply to the camera (view Matrix). After set this up, we just simply multipy the transformed world matrix with view matrix and virtually we now have all the meshes display as the way we looking at in the 3D world throught the camera position. After all, we left last matrix to multiply at, the projection matrix.

Projection Matrix is abit complex, i hope i can explain it well. How are the graphic actually turning the 3D world into our 2D screen? Don't forget that our screen is just a flat thing to displaying thing. Here where the projection matrix do it's works. Projection will convert every vertex in the view matrix into a range of -1 to 1 (in 4 way, up, down, left and right, all in range -1 to 1). Projection Matrix is the matrix which filter out the vertex which actually not visible to the screen and determine which matrix is actually staying in the final rendering.

After turning everything in range to -1 - 1. We need to times the computed range with the Screen acutual pixel (800x600? or 1024x768) to get where actually the vertex reside on the screen. After all, we will time the vector (position) of the vertex with the final matrix can get the final rendering vector, lastly will call the rendering function of direct x, this is beyond this, and me now.

Abit bored and confusing? sorry, i don't think i am a good teacher then :P Actually I'm not 100% sure i knew this concept, still far away. I think I need some practice indeed. I did a software rendering program which actually displaying 2 rotating cube using software drawing but applied all the thing i share. I just refering to the work provided, understand and try to memorize the code and type them out myself. not a proud this to share :P Wait till i code one full 3D program and i will share, hope that happen soon. Okay...i think thats all...tiring...

Today Feeling +=+ I dreamed that i have a son...is that a nightmare??

Saturday, June 10, 2006

World Cup first Match & 3D graphic Fundamentals

Germany 4 - 2 Costa Rica

Ermm, I think most of the people knew this result already, just act as a record lo. I have a bet with Kent for this match, he bet Germany and I took Costa Rica with eating 1 1/2 ball. So bad I lost the bet with the last world class ball score by Frings, Germany. I lost one cup of...Teh O Ice Limao anyway...

This is a good match, a really good start for this year world cup. Time fly and world change, world cup is getting more and more amazing compare to every previous cup. Economic, cash flow, football fever and global effect are very big and ... awesome I can say? Who don't know the exist of World Cup? Not possibe :P. Soccer become more than a sport now I think, people actually get rich and famous of it, economy rise and drop affected by it. World change I think. hehe.

Direct X (3D Graphic Fundamentals)

Well, i am not lazy for these few days, i did read something which John reminded me to read. Everything will grow very high and fast if it had a very stable fundamentals while thing collapse just in one second if the basic is shaking ( sound like pro, got example :P). Okay, okay. I stop reading about coding and function of D3Dx for these days while I got some cool resources from John which got a full detail of 3D fundamentals theory which implemented perfectly with Directx since the resources is about teaching Direct x. So I enjoying reading those stuff for 3 days ( well, my efficiency at Setapak is abit low, since at the same time i have to finish Naruto comic from 21-36 in one day) but that chapter is 100 pages of texts in A4 PDF.

Ermmm, source is confidential, sorry I cant share that out for some reason. But I think it is ok i share what i learnt from it.

3D graphic is all about Mathematic. Two most basic and useful topic of math in 3D graphic is Vector and Matrix. Then is Trigo, Algebra, etc I not yet find out. Vector used in 3D to define the position of vertex, direction of normal for polygon. Matrix mainly use for transforming the vertex in vector form from translation, rotation, scale to pipeline transforming. Using of matrix seem is the most effective way and easier way to implement the transforming of vertex.

Involved D3DX function :
  • D3DXMATRIX
  • D3DXVECTOR3
  • D3DXVec3Cross ( D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV1, CONST D3DXVECTOR3* pV2 );
  • D3DXVec3Dot ( CONST D3DXVECTOR3* pV1, CONST D3DXVECTOR3* pV2 );
  • D3DXVec3Length( CONST D3DXVECTOR3* pV );
  • D3DXVec3Normalize ( D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV );

There are 3 main type of transformation of vertex. Thats translation (moving position of one vertex), rotation and scaling of vertex. vertex position is recorded in 3D vector (or 4D for transforming purpose) then this vector mutiply with Transformation matrix will result a transformed vector. E.G. VectorA x RotationMatrix = VectorRotatedA. The good thing about using matrix is we actually can combine all the transformation matrix as one transform by Multiplying them together. E.G. RotationMatrix X TranslationMatrix = RotateAndTranslateMatrix. This save some operation and calculation effort but need to aware of the arrangement of matrix in multiplying, different placement will result differnt matrix. E.G. A X B != B X A.

There are something need to aware and we may interested in. 4D vector and 4D matrix are actually used in direct x. Why 4D? This is mainly because for translation matrix purpose. Due to the impossible to perform translation with 3D matrix, an extra slot is needed to perform an addition as the translation. the 4th row in matrix is use for translation.

Involved D3DX function :
  • D3DXMatrixMultiply(D3DXMATRIX *pOut, D3DXMATRIX *pA ,D3DXMATRIX *pB)
  • D3DXMatrixRotationX(D3DXMATRIX *pOut, float Angle) Y and Z same.
  • D3DXMatrixTranslation(D3DXMATRIX *pOut, float X, float Y, float Z)
  • D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pOut, float Yaw, float Pitch, float Roll) : yaw - x rotation, Pitch - Y rotation, Roll - Z Rotation
  • D3DXVec3TransformCoord( D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV, CONST D3DXMATRIX* pM );
  • D3DXVec3TransformNormal(D3DXVECTOR3* pOut, CONST D3DXVECTOR3* pV,
    CONST D3DXMATRIX* pM );
  • D3DXVec3Transform ( D3DXVECTOR4* pOut, CONST D3DXVECTOR3* pV,
    CONST D3DXMATRIX* pM);
It seem unreasonable to just put the function there and not explaining...sorry about that, too much to type then :P with the function, It not hard to understand th basic concept but the whole concept may need you to read it from direct x documentation.

I'll share the PipeLine 2 in next blog, so....stay tuned! lol...Just kidding.

Today Feeling : Ermmm, world cup started and life go on.

Wednesday, June 07, 2006

The Rise of Blizzard

Secret Saurce: the Rise of Blizzard

The Escapist Magazine is running an article on the foundations of Blizzard, and how a Developer of B-Grade console games go on to be one of the most successful companies of all time.

Blizzard's 'Secret Sauce' (by Russ Pitts) is an article about Blizzards rise to fame. It includes interviews from Blizzards elite in David Brevik, Mark Kern, and Steig Hedlund.
From GameDev.Net

Monday, June 05, 2006

Vertex Shader, HLSL, DXUT

Overview

I did a lot of reading for these few days regarding vertex shader. I have to find out the reason why Hafiz tell me to learn this instead of keep using Fixe function. While i dare to finally write this out, mean i got the answer lah :P What I personally found out is, vertex shader and FF actually doing the same thing, i mean, their main job is to get the vertex transform, color, lighting done and render to the screen, the different is vertex shader allow programmer to do more thing with the vertex.

Both method is very different discipline in programming sense. Coding of vertex shader is far more different concept and style compare to FF. So i guess i pick a very right time and meet the very right people before I actually start my study on Direct X. I downloaded the latest direct x SDK, inside contained Direct X 10 SDK as well, and the fact is, FF is totally eliminated in Dx10, what is the answer now?

Vertex Shader

A very brief introduction of vertex shader. Directly code to GPU to transform, light and texturing the vertex instead using the fix function. From the website I introduce at previuos achieves (Beyond 3D), i went throught all the pages about the comparison of fix function and vertex shader. What surpise me is vertex shader is all about assembler language (at least it look very alike) and i found it is impossible for me to learn that and code it out, that is too abstract and tedius.

In direct X, here come another thing (which i only learn this after I read the documentation of Direct X 9. They help, alot. Pixel Shader is another shader thingy which actually alter each pixel to be render on the screen, to use vertex shader in Dx, Pixel Shader always come next. To find more information about this, please refer to Dx 9 Documentation-> HLSL part. Again, http://www.microsoft.com/directx to grab your direct x SDK (april 2006 the latest).

HLSL

So i did mentioned about HLSL (High Level Shader Language). I thought I putting myself into a nightmare when i found out that vertex shader is actually about assembler language, how i giong to code that insane. Stupid me forget John did tell me something before, yes, the HLSL. I search around direct X documentation and suddenly find this keyword, I click it and...magic! This is what I want, a higher level language to actually help me to code vertex shader! (I thinkthis is really silly and stupid thing, sorry, i am NooB) :P

HLSL is actually used and code in a file with .FX (effect file in direct x term). I not sure is there any compiler or better IDE to code this since what i opened with is a notepad. HLSL is a higher level language to actually help programmer to do the vertex shader coding but it is still not easy to learn and understand. The style and rules to use it is new to me, i never meet this kind of library before. No doubt that HLSL is far more easier to learn and code compare to ASSEMBLY language i guess.

To get away from using Fixed function pipeline, the only alternative is HLSL now. Though it is damn hard, but still need to learn and use it, it is the future now. My plan now is dont bother a thing of Fix Function Pipeline, and just treat that HLSL is the only way to solve the problem since they 2 are very different thing (for me).

DXUT

DXUT is a cool thing that i found out when i start learning how to use HLSL. Actually i knew it at the very first time but i skiped it because I thought it is a Noobie thing. Sorry for my misunderstanding but DXUT did a very great favour for me (especially a guy who is very weak or know nothing about windows programming).

DXUT is a framework provide by Dx to ease the programmer coding in direct X. DXUT handle the task of creating device, creating windows and handling windows message. Programmer just need to type in some calling function and init for the DXUT then save many lines of codes and can focusing on the part which is more important then retype the windows code again and again.

Well, this is really a Noobie thing, but a very good start for beginner like me i guess. I will write my own library next time to handle this thing, but in this mean time, DXUT do the good thing for me :P

Lastly...start getting lazy to post blog leh :P whatever, I will try to learn more of DXUT and HLSL and looking forward to actually code out something from my own finger very soon.

Today Feeling -- Happy Chatting~

Thursday, June 01, 2006

Beginner Direct X & Life

Life

Today( i should say is yesterday...) is "Duan Wu Jie" a chinese festival, name as DragonBoat festival in english i guess. Traditionally we should eat some "zhong zi" or "Ketupat" in Malay as celebration for this festival and race a dragonboat, sad to say that, i didnt eat any :( The fun thing is the crazy Larry and his Puchong Gang came over to Setapak to have a LATE dinner with us. So we end up at "Dong Jin" or "Tokyo" which located at Setapak Indah. 11 of us ordered 9 plate of dishes which is totally break my life record. The price is STUNNING, why? 11 people 9 plate of dishes just rm 140. Stun? hehe.

Life today is easy, actually I added this topic today because I want to make one chance to share a forward mail, by my friends to share with you all, Malaysian especially. The mail is about some hidden news which actually happened at Malaysia but no media dare to report it on their media tools. So this reporter write an online article and share it within the net. We can see how darkness and controlless of Malaysian freedom now. This article is written in chinese, i guess an english and malay version should be around in anytime and i dont have the actually source of it, i got it in mail form and it is damn long article. So, anyone interest can PM me or leave an comment here and i will forward to mail to you.

Direct X at a very Beginning Stage

I not sure this is useful or not, but this is the answer which I searching all the way when I want to start learning my Direct X. The question is "How actually am I going to make a "hallo world" program in Direct X. For me, the very 1st step to actually start learning a language is know how exactly it going to use and happen something. I read all the books, articles and theory but i still have no idea how actually i can start coding a direct X program. I learnt this today. and stupid me i don't know the answer i seeking all the way is sleeping in my laptop for so long time just the matter i didn't realize it. Where is it? C:\Program Files\Microsoft Direct X SDK June 2005\Sample\Tutorials\ . Now you know why I said i am stupid, because you are laughing too.

(It's actually 5 am now...ahh.....tired)

Okay, what i am trying to share today is how actually is a very damn basic direct X program going to work and actually display some easy stuff on the screen. I going to express in a written and more theory way, mean, no code and if got code, the syntax is not 100% correct :P Find me personally to discuss about it then.

First of all, download the direct x sdk from microsoft.com, it is free. extract it. Get yourself a Visual compiler, recommend is Microsoft Visual Studio 2005. Find the Tools->Option->Project and Solution->VC++ includes. from the second drop down combo, chose Include files and Library files. find the "\include" and "\lib" folder at Direct X SDK folder, add them and move them to the highest place in that list. One thing extra is, when you adding the Library file, you will notice that there are two folder in the \Lib, one is \x86, another one is \x64. I dont know what is that, but i need to include the \x86 to actually compile the tutorial code without a single problem, so...beware of that.

Now you can add any of those sample to the compiler and run them by the time study the code. This is my favourite and fastest way of learning programming and I think most of the people will love this way. I learn a lot of theory and some coding by the Direct 9 RPG programming book but i have no idea how to actually code one. I knew now. Theory + pratical make perfect, hehe.

I like to share some of my OWN guildeline about how actually the D3D thingy flow in the program (this is just Kuan's own view). What i learn today, i think is the basic of the Fixed Pipeline i talked about at previous post, vertex programming is expert mode I think, we need some stepping stone and basic understanding anyway. Don't Fly.

  1. Direct X work in windows, so, it is actually windows programing of C++. WinMain is the entry point of the program. From here you create the Game Loop by peeking the window's message everytime and render the screen.
  2. Before entering your loop, you need to do a lot of initialization. That is the core part of Direct X i think, many, and many of initialization need to be done to get the thing works, but as you did the init, then the work after that is much more easier.
  3. Init a D3D object (g_pD3D). from the obejct, get a parameter variable, and create a device (g_pD3Ddevice). set the renderstate of the device if needed at the Init() function.
  4. After the device is done, Init the Vertex (or geomatry if multiple meshes needed). If both is pass, then only enter the game loop.
  5. In every Render() called. First clear the screen with one color then only begin rendering.
  6. Sequence of rendering is. 1st get the matrices (world, view and projected), 2nd, set the material, 3rd, create the vertex stream and lastly draw it. Repeat if any other meshes appear on the screen. Last thing is swap the back Buffer.
Well, i think this is the most most most basic thing i learnt today. I guess it is still buggy and many features cut of. Will improve it very soon. So i end my post now. SLEEPY.

Today Feeling !!! Friends are wonderful and the people to give meaning to your life.