- Sponsored Advertisement -
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.
WorldToScreen Questions
07-24-2010, 09:44 AM
#1 n00bie Join Date: Sep 2009
Posts: 19
Reputation: 10 Rep Power: 30
WorldToScreen Questions
ok, so i know how to obtain my X,Y,Z and also my View Y, View X and also View Z
1. so, is these views same as yaw/pitch/roll? because the View Z is always 0 ( i think )
and i also know how to find my target's X,Y,Z
2. now how can i find my FOV values? I don't really understand what is it, but i know that my camera can view 35 degrees from the middle of the screen to the end of screen.
3. Can you explain what does the fov in here do? and is it safe to remove it if i know how to check if a player is in view already?
Quote:
Screen.x = (Viewport.Width / 2) * (1 - (Translation.x / FOV.x / Translation.z));
PS: I've heard that SetTransform doesnt work on this game
alQaeda is offline
07-24-2010, 10:08 AM
#2 Level 3
Join Date: May 2005
Posts: 1,103
Reputation: 38964 Rep Power: 494
Quote:
Originally Posted by
alQaeda ok, so i know how to obtain my X,Y,Z and also my View Y, View X and also View Z
1. so, is these views same as yaw/pitch/roll? because the View Z is always 0 ( i think )
and i also know how to find my target's X,Y,Z
2. now how can i find my FOV values? I don't really understand what is it, but i know that my camera can view 35 degrees from the middle of the screen to the end of screen.
3. Can you explain what does the fov in here do? and is it safe to remove it if i know how to check if a player is in view already?
PS: I've heard that SetTransform doesnt work on this game
your gonna need xyz ,pitch yaw roll. you can play around with fov if need be...if z is 0 if there is a lean check it while leaning.
2)search for 35 degrees in radians float
wat game is it? I looked at ur post and guessing its black shot log this for me and post it
D3DXMATRIX mConceated;
m_pD3Ddev->GetVertexShaderConstantF(0,mConceated,4);
Log all the floats in there
mConceated._11 mConceated._12 ....
mConceated._22 mConceated._22 etc
ill be up im working on the same thing atm for diesiel engine which is fuckin gay.....proj matrix w/o znear and far planes :/ !!! works but moves to much :/
Last edited by fatboy88; 07-24-2010 at 10:21 AM .
fatboy88 is online now
07-24-2010, 10:19 AM
#3 n00bie
Threadstarter Join Date: Sep 2009
Posts: 19
Reputation: 10 Rep Power: 30
Sorry, forgot to mention, its for BlackShot ,
is cameraview x,y,z the same as pitch,yaw,roll? and you cant lean in this game, so i think z would be useless right?
edit: here
11 : 0.0
12 : 7701946880.0
13 : 0.0
14 : 0.0
21 : 0.0
22 : 0.0
23 : 0.0
24 : 0.0
31 : 0.0
32 : 0.0
33 : 8223764480.0
34 : 0.0
41 : 0.0
42 : 0.0
43 : 0.0
44 : 0.0
looks wrong, are there any conditions? i did this in Present
Last edited by alQaeda; 07-24-2010 at 11:18 AM .
alQaeda is offline
07-24-2010, 11:30 AM
#4 Level 3
Join Date: May 2005
Posts: 1,103
Reputation: 38964 Rep Power: 494
Quote:
Originally Posted by
alQaeda Sorry, forgot to mention, its for BlackShot ,
is cameraview x,y,z the same as pitch,yaw,roll? and you cant lean in this game, so i think z would be useless right?
edit: here
11 : 0.0
12 : 7701946880.0
13 : 0.0
14 : 0.0
21 : 0.0
22 : 0.0
23 : 0.0
24 : 0.0
31 : 0.0
32 : 0.0
33 : 8223764480.0
34 : 0.0
41 : 0.0
42 : 0.0
43 : 0.0
44 : 0.0
looks wrong, are there any conditions? i did this in Present
ya that looks wrong , could add a log in setvertexshaderconstf see what start registers are logged with vec4count of 3-4(rinse and repeat to see if the startregister changes). also look at ntkids post and log them to see if the index changes if it does you can use D3DXHANDLE Handle = pConstantTable->GetConstantByName(0,"COnstantnameHere");
to retrieve current index
a couple example logs from a game i logged earlier today
proj matrix: missing zf / zn calcs
Code:
Row1 : 1.7 0.0 0.0 0.0
Row2 : 0.0 2.3 0.0 0.0
Row3 : 0.0 0.0 1.0 -10.0
Row4 : 0.0 0.0 1.0 0.0 view matrix transposed
Code:
Row1 : -1.0 0.2 -0.0 -62.8
Row2 : -0.0 -0.2 1.0 109.8
Row3 : -0.2 -1.0 -0.2 4046.7
Row4 : 0.0 0.0 0.0 1.0 view matrix untransposed
Code:
Row1 : -0.5 -0.1 -0.8 0.0
Row2 : 0.9 -0.1 -0.5 0.0
Row3 : -0.0 1.0 -0.1 0.0
Row4 : 719.7 107.9 5303.8 1.0 world* View* proj transposed WorldviewProjMatrix
Code:
Row1 : 0.4 1.7 -0.0 -125.5
Row2 : 0.1 -0.0 2.3 217387.1
Row3 : -1.0 0.2 0.0 1487.0
Row4 : -1.0 0.2 0.0 2486.9
end
Last edited by fatboy88; 07-24-2010 at 11:42 AM .
fatboy88 is online now
07-24-2010, 11:39 AM
#5 n00bie
Threadstarter Join Date: Sep 2009
Posts: 19
Reputation: 10 Rep Power: 30
ill read up more stuff first, kinda hard to understand
anyway i used one of the code i found to dump these
Quote:
doDisassembleShader Code:
//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.11.519.0000
//
// Parameters:
//
// float4 Light0_Amb;
// float4 ObjAmbient;
//
//
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// Light0_Amb c0 1
// ObjAmbient c1 1
//
//
// Default values:
//
// Light0_Amb
// c0 = { 0, 0, 0, 0 };
//
// ObjAmbient
// c1 = { 0, 0, 0, 0 };
//
preshader
mul c73.xyz, c0.xyz, c1.xyz
// approximately 1 instruction used
//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.11.519.0000
//
// Parameters:
//
// float4x3 Bone[20];
// float DOFPintFactor;
// float3 DOFPintPosition;
// float4 Light0_Diff;
// float3 Light0_Dir;
// float3 Light1_Pos;
// float4 ObjDiffuse;
// float4x4 ViewProj;
// float4x4 _WorldViewI;
// bool bUseBumpMap;
//
//
// Registers:
//
// Name Reg Size
// --------------- ----- ----
// bUseBumpMap b0 1
// Bone c0 60
// ViewProj c60 4
// _WorldViewI c64 3
// DOFPintPosition c67 1
// DOFPintFactor c68 1
// Light0_Dir c69 1
// Light0_Diff c70 1
// Light1_Pos c71 1
// ObjDiffuse c72 1
//
//
// Default values:
//
// bUseBumpMap
// b0 = true;
//
// Bone
// c0 = { 0, 0, 0, 0 };
// c1 = { 0, 0, 0, 0 };
// c2 = { 0, 0, 0, 0 };
// c3 = { 0, 0, 0, 0 };
// c4 = { 0, 0, 0, 0 };
// c5 = { 0, 0, 0, 0 };
// c6 = { 0, 0, 0, 0 };
// c7 = { 0, 0, 0, 0 };
// c8 = { 0, 0, 0, 0 };
// c9 = { 0, 0, 0, 0 };
// c10 = { 0, 0, 0, 0 };
// c11 = { 0, 0, 0, 0 };
// c12 = { 0, 0, 0, 0 };
// c13 = { 0, 0, 0, 0 };
// c14 = { 0, 0, 0, 0 };
// c15 = { 0, 0, 0, 0 };
// c16 = { 0, 0, 0, 0 };
// c17 = { 0, 0, 0, 0 };
// c18 = { 0, 0, 0, 0 };
// c19 = { 0, 0, 0, 0 };
// c20 = { 0, 0, 0, 0 };
// c21 = { 0, 0, 0, 0 };
// c22 = { 0, 0, 0, 0 };
// c23 = { 0, 0, 0, 0 };
// c24 = { 0, 0, 0, 0 };
// c25 = { 0, 0, 0, 0 };
// c26 = { 0, 0, 0, 0 };
// c27 = { 0, 0, 0, 0 };
// c28 = { 0, 0, 0, 0 };
// c29 = { 0, 0, 0, 0 };
// c30 = { 0, 0, 0, 0 };
// c31 = { 0, 0, 0, 0 };
// c32 = { 0, 0, 0, 0 };
// c33 = { 0, 0, 0, 0 };
// c34 = { 0, 0, 0, 0 };
// c35 = { 0, 0, 0, 0 };
// c36 = { 0, 0, 0, 0 };
// c37 = { 0, 0, 0, 0 };
// c38 = { 0, 0, 0, 0 };
// c39 = { 0, 0, 0, 0 };
// c40 = { 0, 0, 0, 0 };
// c41 = { 0, 0, 0, 0 };
// c42 = { 0, 0, 0, 0 };
// c43 = { 0, 0, 0, 0 };
// c44 = { 0, 0, 0, 0 };
// c45 = { 0, 0, 0, 0 };
// c46 = { 0, 0, 0, 0 };
// c47 = { 0, 0, 0, 0 };
// c48 = { 0, 0, 0, 0 };
// c49 = { 0, 0, 0, 0 };
// c50 = { 0, 0, 0, 0 };
// c51 = { 0, 0, 0, 0 };
// c52 = { 0, 0, 0, 0 };
// c53 = { 0, 0, 0, 0 };
// c54 = { 0, 0, 0, 0 };
// c55 = { 0, 0, 0, 0 };
// c56 = { 0, 0, 0, 0 };
// c57 = { 0, 0, 0, 0 };
// c58 = { 0, 0, 0, 0 };
// c59 = { 0, 0, 0, 0 };
//
// ViewProj
// c60 = { 0, 0, 0, 0 };
// c61 = { 0, 0, 0, 0 };
// c62 = { 0, 0, 0, 0 };
// c63 = { 0, 0, 0, 0 };
//
// _WorldViewI
// c64 = { 0, 0, 0, 0 };
// c65 = { 0, 0, 0, 0 };
// c66 = { 0, 0, 0, 0 };
//
// DOFPintPosition
// c67 = { 0, 0, 0, 0 };
//
// DOFPintFactor
// c68 = { 0, 0, 0, 0 };
//
// Light0_Dir
// c69 = { 0, 0, 0, 0 };
//
// Light0_Diff
// c70 = { 0, 0, 0, 0 };
//
// Light1_Pos
// c71 = { 0, 0, 0, 0 };
//
// ObjDiffuse
// c72 = { 0, 0, 0, 0 };
//
vs_2_0
def c74, 1, 765.005859, -0.100000001, 0
def c75, 0.200000003, 0, 0, 0
dcl_position v0
dcl_blendweight v1
dcl_blendindices v2
dcl_normal v3
dcl_binormal v4
dcl_tangent v5
dcl_texcoord v6
mul r0, v2.zyxw, c74.y
mova a0, r0
add r1.w, -v1.x, c74.x
mul r0, v1.y, c2[a0.y]
add r1.w, r1.w, -v1.y
mad r0, v1.x, c2[a0.x], r0
add r4.w, r1.w, -v1.z
mad r0, v1.z, c2[a0.z], r0
mad r2, r4.w, c2[a0.w], r0
dp4 r0.z, v0, r2
mul r3, v1.y, c0[a0.y]
mul r1, v1.y, c1[a0.y]
mad r3, v1.x, c0[a0.x], r3
mad r1, v1.x, c1[a0.x], r1
mad r3, v1.z, c0[a0.z], r3
mad r1, v1.z, c1[a0.z], r1
mad r5, r4.w, c0[a0.w], r3
mad r4, r4.w, c1[a0.w], r1
dp4 r0.x, v0, r5
dp4 r0.y, v0, r4
add r1.xyz, -r0, c67
dp3 r1.x, r1, r1
rsq r0.w, r1.x
rcp r0.w, r0.w
dp3 r1.x, v3, r5
mov r1.y, c74.z
mad r0.w, r0.w, c68.x, r1.y
dp3 r1.y, v3, r4
max r0.w, r0.w, c74.w
dp3 r1.z, v3, r2
min r0.w, r0.w, c74.x
nrm r6.xyz, r1
add oT0.z, r0.w, c75.x
if b0
dp3 r1.x, v4, r5
dp3 r1.y, v4, r4
dp3 r1.z, v4, r2
dp3 r3.z, r0, r6
nrm r7.xyz, r1
dp3 r1.y, -c71, r7
dp3 r5.x, v5, r5
dp3 r5.y, v5, r4
dp3 r5.z, v5, r2
nrm r2.xyz, r5
mov r5.x, c64.w
mov r5.y, c65.w
mov r5.z, c66.w
dp3 r1.x, -c71, r2
dp3 r4.z, r5, r6
mov oD0.xyz, c74.w
dp3 r4.x, r5, r2
dp3 r4.y, r5, r7
dp3 r3.x, r0, r2
dp3 r3.y, r0, r7
dp3 r2.x, -c69, r2
dp3 r2.y, -c69, r7
dp3 r2.z, -c69, r6
dp3 r1.z, -c71, r6
else
dp3 r1.x, r6, c69
max r0.w, r1.x, c74.w
mul r1.xyz, r0.w, c70
mov r2.xyz, c72
mad oD0.xyz, r1, r2, c73
mov r1.xyz, c74.w
mov r4.xyz, r1.x
mov r3.xyz, r1.x
mov r2.xyz, r1.x
endif
mov r4.w, c74.w
mov oT1, r4
mov r3.w, c74.w
mov r2.w, c74.w
mov oT2, r3
mov oT3, r2
mov r1.w, c74.w
mov r0.w, c74.x
mov oT4, r1
dp4 oPos.w, r0, c63
dp4 oPos.x, r0, c60
dp4 oPos.y, r0, c61
dp4 oPos.z, r0, c62
mov oT0.xy, v6
// approximately 91 instruction slots used and ReadConstantTable : Code:
Name=[Bone]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[0]
RegisterCount=[60]
Class=[D3DXPC_MATRIX_COLUMNS]
Type=[D3DXPT_FLOAT]
Rows=[4]
Columns=[3]
Elemets=[20]
StructMembers=[0]
Bytes=[960]
DefaultValue=[0x22BF108C]
StartRegister=[0]
END
Name=[DOFPintFactor]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[68]
RegisterCount=[1]
Class=[D3DXPC_SCALAR]
Type=[D3DXPT_FLOAT]
Rows=[1]
Columns=[1]
Elemets=[1]
StructMembers=[0]
Bytes=[4]
DefaultValue=[0x22BF146C]
StartRegister=[1]
END
Name=[DOFPintPosition]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[67]
RegisterCount=[1]
Class=[D3DXPC_VECTOR]
Type=[D3DXPT_FLOAT]
Rows=[1]
Columns=[3]
Elemets=[1]
StructMembers=[0]
Bytes=[12]
DefaultValue=[0x22BF146C]
StartRegister=[2]
END
Name=[Light0_Diff]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[70]
RegisterCount=[1]
Class=[D3DXPC_VECTOR]
Type=[D3DXPT_FLOAT]
Rows=[1]
Columns=[4]
Elemets=[1]
StructMembers=[0]
Bytes=[16]
DefaultValue=[0x22BF146C]
StartRegister=[3]
END
Name=[Light0_Dir]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[69]
RegisterCount=[1]
Class=[D3DXPC_VECTOR]
Type=[D3DXPT_FLOAT]
Rows=[1]
Columns=[3]
Elemets=[1]
StructMembers=[0]
Bytes=[12]
DefaultValue=[0x22BF146C]
StartRegister=[4]
END
Name=[Light1_Pos]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[71]
RegisterCount=[1]
Class=[D3DXPC_VECTOR]
Type=[D3DXPT_FLOAT]
Rows=[1]
Columns=[3]
Elemets=[1]
StructMembers=[0]
Bytes=[12]
DefaultValue=[0x22BF146C]
StartRegister=[5]
END
Name=[ObjDiffuse]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[72]
RegisterCount=[1]
Class=[D3DXPC_VECTOR]
Type=[D3DXPT_FLOAT]
Rows=[1]
Columns=[4]
Elemets=[1]
StructMembers=[0]
Bytes=[16]
DefaultValue=[0x22BF146C]
StartRegister=[6]
END
Name=[ViewProj]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[60]
RegisterCount=[4]
Class=[D3DXPC_MATRIX_COLUMNS]
Type=[D3DXPT_FLOAT]
Rows=[4]
Columns=[4]
Elemets=[1]
StructMembers=[0]
Bytes=[64]
DefaultValue=[0x22BF14F4]
StartRegister=[7]
END
Name=[_WorldViewI]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[64]
RegisterCount=[3]
Class=[D3DXPC_MATRIX_COLUMNS]
Type=[D3DXPT_FLOAT]
Rows=[4]
Columns=[4]
Elemets=[1]
StructMembers=[0]
Bytes=[64]
DefaultValue=[0x22BF14F4]
StartRegister=[8]
END
Name=[bUseBumpMap]
RegisterSet=[D3DXRS_BOOL]
RegisterIndex=[0]
RegisterCount=[1]
Class=[D3DXPC_SCALAR]
Type=[D3DXPT_BOOL]
Rows=[1]
Columns=[1]
Elemets=[1]
StructMembers=[0]
Bytes=[4]
DefaultValue=[0x22BF155C]
StartRegister=[9]
END
alQaeda is offline
07-24-2010, 02:24 PM
#6 Broken Moderator
Join Date: Aug 2006
Location: United States
Posts: 760
Reputation: 33567 Rep Power: 418
Points: 23,105, Level: 21
Last Achievements Check out the 7th and 8th shader. ViewProj/_WorldViewI
kolbybrooks is online now
07-24-2010, 09:17 PM
#7 Level 3
Join Date: May 2005
Posts: 1,103
Reputation: 38964 Rep Power: 494
Quote:
Originally Posted by
kolbybrooks Check out the 7th and 8th shader. ViewProj/_WorldViewI
ya hope fully vieproj is just proj* view it looks that way by the dump , also it looks transposed.
thing is worldviewinv
world is inversed its usally object space when the view is inversed its world space.
:/
log is needed to see translation etc. It could be a bill board matrix
keep inmind of how these matrices are used after you log
Code:
dp4 oPos.w, r0, c63
flaot pos.w = D3DXVec4Dot(r0,D3DXVECTOR4(ViewProj._41,ViewProj._42,ViewProj._43,ViewProj._44 ));
mov r5.x, c64.w r5.x =WorldViewI._14 //translation/transposed???? ;D
mov r5.y, c65.w r5.y =WorldViewI._24
mov r5.z, c66.w r5.z =WorldViewI._34
etc.
Last edited by fatboy88; 07-28-2010 at 11:21 AM .
fatboy88 is online now
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 10:50 AM .