Re: [問題] c語言程式求助
LPDIRECT3DTEXTURE9 texture;
1. 首先作一張 1 x 1 的 rendered texture
d3dDevice->CreateTexture (1, 1, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R32F,
D3DPOOL_DEFAULT, &texture, NULL);
2. 放入以下兩個 Shader
vs_2_0
def c1, 0, 0, 0, 0
dcl_position v0
dcl_texcoord v1
mov oPos, c1
mov oT0, c0
ps_2_0
def c0, 0.454, 0, 0, 0
dcl t0.xy
mov r0.xy, t0.xy
mul oC0, r0.xxxx, c0.xxxx
3. 輸入
float input;
scanf ("%f", &input);
d3dDevice->SetVertexShaderConstantF (0, &input, 1);
4. Render 後利用 GetRenderTargetData 從顯示卡傳回記憶體 ...
--
更!! 給顯卡算真麻煩 ...
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.44.182.125
推
10/14 01:49, , 1F
10/14 01:49, 1F
推
10/14 01:49, , 2F
10/14 01:49, 2F
→
10/14 01:50, , 3F
10/14 01:50, 3F
推
10/14 01:55, , 4F
10/14 01:55, 4F
推
10/14 01:59, , 5F
10/14 01:59, 5F
討論串 (同標題文章)