dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Problema ar Hardware vertex processing

 
dev.gamez.lv Forum Index -> Microsoft DirectX
View previous topic :: View next topic  
Author Message
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Mon Apr 17, 2006 8:43 pm    Post subject: Problema ar Hardware vertex processing

Probleema:
Ka uztaisu direct 3D device (CreateDevice) ar parametru BehaviorFlags vienaadu ar D3DCREATE_SOFTWARE_VERTEXPROCESSING,viss ir kaartiibaa.Bet kad izmantoju D3DCREATE_HARDWARE_VERTEXPROCESSING,visi poligoni ziimeejas melni.Es izmantoju vertex shaderus abos variantos.
Te buus shaderu kods:
Code:

;Constants
;c0-c3   = WorldViewProjMatrix
;c4.x   = 0.0
;c4.y   = 1.0
;c4.z   = FogEnd
;c4.w   = 1.0f/(fFogEnd-fFogStart)

vs.1.1
dcl_position0   v0
dcl_normal0   v3
dcl_texcoord0   v6

m4x4 oPos,v0,c0 ;sareizinam poziiciju ar matricu
mov oT0,v6

;Fog calculation c0-pziicija

dp4 r0, v0, c3      ;dot product-distance to camera r0=distance
add r1.x, c4.z, -r0.z   ;FogEnd - Distance
mul r1.x, r1.x, c4.w   ;(FogEnd - Distance)/(FogEnd-FogStart)
max r1.x, r1.x, c4.x   ;Maximums ir 1
min oFog, r1.x, c4.y   ;Minimums ir 0

un
Code:

ps.1.1
tex t0
mul r0,v0,t0 ;sareizinam kraasu ar tekstuuru

Meegjinaaju:
atsleegt vertex shaderus,bet tad vispaar uz ekraana nekaa netika ziimeets.Meegjinaaju citaam pashtaisiitajaam programmaam ielikt
D3DCREATE_HARDWARE_VERTEXPROCESSING,bet tur viss stradaja.NEVARU atrast,kur ir probleema.Izmeekleejos visur!Nekaadu rezultaatu.

Varbuut kaadam ir kaada nojausma,kas par probleemu.Varbuut probleema shaderos.Nesaprotu.
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
Vecais_Dumais_Laacis
Guru
Guru


Joined: 29 Jan 2004
Posts: 800

PostPosted: Mon Apr 17, 2006 10:32 pm    Post subject:

nu ja ziimeejaas melni tad skaties kas ar pixel shaderiem - vai hardware uztur shamos. jo vertex shaderis jau tikai vertexus process - melnumu tev pixel shaderis taisa
_________________
...un ja bites buutu laachi...
Back to top
View user's profile
anggelus



Joined: 23 Feb 2005
Posts: 383
Location: Rīga (LV)

PostPosted: Mon Apr 17, 2006 11:28 pm    Post subject:

1. pārliecinies vai VertexDeclaration ir pareizs, dažkārt arī ar nepareizu uz Software viss darbojas bet uz Hardware ne.
2. problēma varētu būt arī draiveros, pamēģini citu versiju.
_________________
No comprendo lo que dice.
Back to top
View user's profile Send e-mail
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Tue Apr 18, 2006 10:46 am    Post subject:

Videokarte man GeForce 6600GT,taka tur nevaretu but problema. Draiveri ari pedejie.Paskatishos vertex declaration un Pixel shaderi.
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Tue Apr 18, 2006 4:55 pm    Post subject:

Atradu!Taisniba vien bija,ka kluuda sheiderii,bet tomeer vertex shaderii.
Iztruuka shitaa rindinja:
Code:

mov oD0,c5 ;izvadam diffuse

Taatad vertexiem vienkaarshi nebija kraasas, liidz ar to tie bija melni (bet software vertex processingaa tie bija balti).
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
Display posts from previous:   
dev.gamez.lv Forum Index -> Microsoft DirectX All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group