Sign in to follow this  

DirectX10 Highlighting

This topic is 3502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a beginner for directx 10 programming,and I have a problem how to highlight an object(make it reflect rays on the edge). Can anyone give me any suggestions? Thanks for help.

Share this post


Link to post
Share on other sites
Did you mean specular effect?

You can turn it on by setting the render state.

p9device->SetRenderState(D3DRS_SPECULARENABLE, true);

But you must setting up the light already.

Hope this will help.

Share this post


Link to post
Share on other sites
Quote:
Original post by haxpor
Did you mean specular effect?

You can turn it on by setting the render state.

p9device->SetRenderState(D3DRS_SPECULARENABLE, true);

But you must setting up the light already.

Hope this will help.




Excuse me,it seems like some direct9 code,how can I do this using direct10?

Share this post


Link to post
Share on other sites
Specular is not what you want (that is a component of the BRDF lighting model) - yes, it makes things shiny, but it doesn't make things glow.

You cannot use that code in D3D10 - those functions are all "fixed function" which was completely dropped.

Look at the PostProcess sample in the SDK. It's not for D3D10, but the algorithm is the same and the implementation is going to be very close. Otherwise, try digging around in ATI and Nvidia's developer SDK's.

hth
Jack

Share this post


Link to post
Share on other sites
Hi,Jack!At last I have made out what the glow effect is and how I can perform it.And just as you said,the source code of nvidia samples is a little complex.

Commonly,we have to do three steps of job.First,do a normal-based edge detection(seperate the edge and other part of the object with different colors).Then,perform a blur effect.Finally,combine the result with the original image.Is that right?

Otherwise,I find myself difficult in the HLSL language,can you introduce me some useful books.


Thanks for your help.

Share this post


Link to post
Share on other sites
Quote:
Original post by Silver Fox

Commonly,we have to do three steps of job.First,do a normal-based edge detection(seperate the edge and other part of the object with different colors).Then,perform a blur effect.Finally,combine the result with the original image.Is that right?



Yes, that's the basic gist of it. Typically the image is also downscaled for a process like this, then upscaled and combined with the original. This make the blurring cheaper, and also makes the glow have a greater effect.



Share this post


Link to post
Share on other sites
Quote:
Original post by Silver Fox
Commonly,we have to do three steps of job.First,do a normal-based edge detection(seperate the edge and other part of the object with different colors).Then,perform a blur effect.Finally,combine the result with the original image.Is that right?
Not far off but it would be more common to use a high-pass filter than an edge-detect. The blurring is usually to simulate the bleeding you'd get through a lens with very bright light - thus you want to high-pass and reject any pixels with a brightness behind a certain threshold.

However, the fun of post-processing effects is that you can throw in different steps and still get interesting results back. Try the edge-detect, it might well give you some pretty cool effects - I suspect it might give you a sort of halo/outline result.

Quote:
Original post by Silver Fox
Otherwise,I find myself difficult in the HLSL language,can you introduce me some useful books.
I don't tend to read graphics books (except for the older classic texts) but you could look into the ShaderX series and/or GPU Gems.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Original post by Silver Fox
Commonly,we have to do three steps of job.First,do a normal-based edge detection(seperate the edge and other part of the object with different colors).Then,perform a blur effect.Finally,combine the result with the original image.Is that right?
Not far off but it would be more common to use a high-pass filter than an edge-detect. The blurring is usually to simulate the bleeding you'd get through a lens with very bright light - thus you want to high-pass and reject any pixels with a brightness behind a certain threshold.


He wants to do an edge-glow effect, like in the D3D9 PostProcess sample (not a straight-up bloom). That's why he's talking about doing an edge-detection on the normals, and not a threshold.

Share this post


Link to post
Share on other sites

This topic is 3502 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this