Go Back   UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats > Anti-Cheat Software & Programming > Direct3D

- Sponsored Advertisement -
http://www.myfpscheats.com/

Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
Direct3D
hacking programming reversing
You are Unregistered, please register to gain Full access.    
Reply
 
Thread Tools

Viewport matrix
Old 07-28-2010, 01:24 AM   #1
Level 3

fatboy88's Avatar

Join Date: May 2005
Posts: 1,103
Reputation: 38964
Rep Power: 494
fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!
Recognitions:
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 27,267, Level: 24
Points: 27,267, Level: 24 Points: 27,267, Level: 24 Points: 27,267, Level: 24
Activity: 9.9%
Activity: 9.9% Activity: 9.9% Activity: 9.9%
Last Achievements
Viewport matrix

I was looking at some shaders in the diesel engine there was one for viewport matrix so I investigated.

Viewport Transformation

shows how to set up a vp matrix and well im just wondering do guys think there would be a performance increase using it IF you create the matrix once and only call getviewport when the resolution changes? With it you now have another d3dxmatrixmultiply I'm just wonder if you think the performance effects are worth the trouble and matrixmultiply call. or just backing them up viewport and doing w2s manually w/o d3dxvec3project.

Code:
f(!Created)
  {
          D3DVIEWPORT9 viewPort;
          pDevice->GetViewport(&viewPort);

		  float CenterScreenX = viewPort.Width/2;
		  float CenterScreenY = viewPort.Height/2;
		  vP._11 =  CenterScreenX;
		  vP._22 = -CenterScreenY;
		  vP._33 = viewPort.MaxZ - viewPort.MinZ;
		  vP._41 = viewPort.X + CenterScreenX;
		  vP._42 = viewPort.Y + CenterScreenY;
		  vP._43 = viewPort.MinZ;
		  vP._44 = 1;
  
  Created = true;
  }
Code:
                         D3DXMatrixMultiply(&m1, &world, &view);
			 D3DXMatrixMultiply(&m2, &m1, &projection);
			 D3DXMatrixMultiply(&m3, &m2, &vP);
			 D3DXVec3TransformCoord(&vScreenCoord, &vWorldLocation, &m3);

if(vScreenCoord.z < 1){
text(x,y);
}
__________________


My greatest fear is a Windows Vista Update! D:

ȜǷ-ɲآɳᶨ4 Hack:http://img42.imageshack.us/img42/473/20090203132330.png

Last edited by fatboy88; 07-28-2010 at 03:15 AM.
fatboy88 is online now

Reply With Quote


Old 08-04-2010, 06:31 PM   #2

CallMeEclipse's Avatar

Join Date: Jul 2009
Location: California
Posts: 2,330
Reputation: 33489
Rep Power: 412
CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!CallMeEclipse has a huge epeen!
Delta Fighter Champion Jumpin Joe Champion
Recognitions:
Members who have contributed financial support towards UnKnoWnCheaTs. Donation (1)
Points: 26,395, Level: 23
Points: 26,395, Level: 23 Points: 26,395, Level: 23 Points: 26,395, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Last Achievements
Its probably better to only call it if the resolution changes, but you may as well try it and see how it works out either way.
__________________


(1217 AM) uNrEaL: One man's slap in the face is another man's slit throat
CallMeEclipse is offline

Reply With Quote

Old 08-04-2010, 07:47 PM   #3
Level 3

fatboy88's Avatar

Threadstarter
Join Date: May 2005
Posts: 1,103
Reputation: 38964
Rep Power: 494
fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!fatboy88 has a huge epeen!
Recognitions:
The UC Member of the Month award is a prestigious award given to a single community member on a monthly basis. Based on a vote by UnKnoWnCheaTs staff, the award is given to the forum member that has shown exemplary achievement and potential in the UnKnoWnCheaTs community, and has shown great commitment to upholding the principles upon which UnKnoWnCheaTs stands for. A member who has been awarded the Member of the Month award has been distinguished as an asset to the UnKnoWnCheaTs community. Member of the Month
Points: 27,267, Level: 24
Points: 27,267, Level: 24 Points: 27,267, Level: 24 Points: 27,267, Level: 24
Activity: 9.9%
Activity: 9.9% Activity: 9.9% Activity: 9.9%
Last Achievements
Quote:
Originally Posted by CallMeEclipse View Post
Its probably better to only call it if the resolution changes, but you may as well try it and see how it works out either way.
ya thats how i already do it, I also do the projection like that and check if zooming/resolution change

Quote:
backing up viewport and doing w2s manually w/o d3dxvec3project
tho i still go ahead and back up the entire proj matrix(plan on eliminating the matrix part also only did it cuz vertex & pixel shader ten to use only ViewProj matrix), and dont use world at all :x
__________________


My greatest fear is a Windows Vista Update! D:

ȜǷ-ɲآɳᶨ4 Hack:http://img42.imageshack.us/img42/473/20090203132330.png

Last edited by fatboy88; 08-04-2010 at 07:54 PM.
fatboy88 is online now

Reply With Quote
Reply  

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit



Tags
matrix, transform, viewport, w2s, worldtoscreen
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT +1. The time now is 06:14 AM.