• Advertisement
  • entries
    422
  • comments
    1540
  • views
    489625

April 2006 SDK

Sign in to follow this  

94 views

For those that don't read the news or the DirectX forum you might be interested to know that the April 2006 SDK update is now available.

David Weller beat me and the other MVPs to the announcement this time, but I was asleep when it went live so I reckon he cheated.

I'm personally hanging on until the April CTP of Vista is made available. Despite having 5308 working just fine on this machine I can't get it to reinstall after I wiped it for 5342 [rolleyes]

All good journals must have pictures, so heres a few comparison images that I'm using for the report I'm having so much fun writing at the moment:













I spotted a really retarded mistake in two of my shaders this morning:

float3 Normal = normalize( ( 2.0f * tex2D( sampNormMap, v.TexCoord ) ) - 1.0f );

should be

float3 Normal = normalize( ( 2.0f * tex2D( sampNormMap, v.TexCoord ).xyz ) - 1.0f );

Spot the difference, and cookies to the person who knows why it's such a dumb mistake [smile]
Sign in to follow this  


7 Comments


Recommended Comments

Quote:
Spot the difference, and cookies to the person who knows why it's such a dumb mistake


Because you might end up grabbing a float4 from the tex2D, and one of two bad things could happen:
1) The normalization trys to take into account the 4th component.
2) The float4 result will get shoehorned into the float3 variable, and for that you don't specify what components it gets.

Share this comment


Link to comment
You get the cookies [grin]

It was the first option - normalize() was operating on a 4-component vector and then getting truncated to a 3-component one. Net result is that the float3 normal was not actuall unit length, thus making a lot of the lighting dull!

I'm pretty sure it was just a dumbass typo on my part - every other occurence of a similar line is correct... oh well!

Share this comment


Link to comment
Woooow, they look so pretty! Can't wait til I get to do some stuff like this in my engine :) Do you have any plans for translucent materials?

Share this comment


Link to comment
Quote:
Do you have any plans for translucent materials?
Not in this project, but I could probably expand to cover those for a later revision.

Biggest problem with transparency is that I'm also using HDRI - HDRI and blending might be possible, but performance isn't amazing. Thus even moderate blending through semi-transparent objects might just push it over the limit [oh]

Cheers,
Jack

Share this comment


Link to comment
Quote:
Do you have any plans for translucent materials?
Not in this project, but I could probably expand to cover those for a later revision.

Biggest problem with transparency is that I'm also using HDRI - HDRI and blending might be possible, but performance isn't amazing. Thus even moderate blending through semi-transparent objects might just push it over the limit [oh]

Cheers,
Jack

Share this comment


Link to comment
Quote:
2) The float4 result will get shoehorned into the float3 variable, and for that you don't specify what components it gets.


If it gets truncated the last float will just be dropped every time, so that's not really a problem.

Share this comment


Link to comment
> every other occurence of a similar line is correct...

You mean you don't program with copy/paste?

I always make the mistake where the place that should be different is the same as all the other copies.

Share this comment


Link to comment

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

  • Advertisement