short hlsl doubt

Started by
5 comments, last by xyzzy00 18 years, 7 months ago
Good evening, I'm doing my final project programming Grpahic CArd for an image processing application. I have just a doubt, and I think you will can answer me really easily without take you many time. I know that you can write into oC registers with the mov instruction for after ps_2_0 versions. But using HLSL how can I choose the destinations registers? I need to write 17 floats. I made a transformation for a original image. So i will need 8 floats for weights for each neightborhood, 8 of them are the current values of the pixels in my texture (image) transformed, and the last one, is the pixel vale in my original image. I'm trying to made a joint histogram. And I have 20 floats possible, as I have 4 registers oC# (with four floats each one) and 4 more thans to oDepth. Can you tell me how to write this in HLSL? Or just indicated me where can i founded it ?? Thank you very much and hope to get a useful answer!!
Advertisement
void MyPixelShader(
out float4 oC[4] : COLOR,
out float oDepth : DEPTH)
{
oC[0] = ???;
oC[1] = ???;
oC[2] = ???;
oC[3] = ???;
oDepth = ???;
}

xyzzy
Great!! Thanks...
Just two short questions more!!
Where have you learn that??
...it's not wasy to found the documentation ...!
And the second one ...!
How can I tested if my graphic card doesn't support ps_2_0 ...
would be possible using ps_2_sw???

And..could it work using ps_2_sw if it doen-t support neither 4 semultaneously render target ??

Thanks xyzzy!!! Very Useful!

Jesus!
Best place to learn about HLSL is looking at examples, because there really is a serious lack of documentation about it. Download the ATI Rendermonkey package, and the nVidia FX Composer. The nVidia one is better, but check them both out and try and go through the simple ones, like basic lighting for instance.

As for testing for Shader Model 2 compatibility, if you just want to know what your card supports then get the programs I mentioned above and try and load a VS/PS2.0 shader -- it wont work :( If you mean that you need to detect it on the users system, the information can be found in the Directx object class that you create on initialization.
Hi!
The packages are great, and the examples too! But ... I have a doubt about them.

How can I program my effects ??
I have Just to wtire my Pixel Shader, Vertex Shader and define the inputs and constants ???

When I execute some projects...in the RenderMonkey they work (even they should use ps_2_0 ... but on the nvidia it doesn't. Wich is the reason ???
Thanks!
JEsus
What card do you have?
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
> Where have you learn that??
> ...it's not wasy to found the documentation ...!

I don't know.. it just seemed like how I would do it if I was writing it :)


> How can I tested if my graphic card doesn't support ps_2_0 ...

You can use D3DXGetPixelShaderProfile to determine which HLSL pixel shader profile your device supports.


> would be possible using ps_2_sw??? And..could it work using ps_2_sw if
> it doen-t support neither 4 semultaneously render target ??

I wouldn't consider using ps_2_sw unless you are using the Reference Rasterizer to render your scene. This can be VERY slow.

xyzzy

[Edited by - xyzzy00 on September 7, 2005 11:08:12 AM]

This topic is closed to new replies.

Advertisement