Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Jun 2007
Online Last Active Today, 01:47 AM

Posts I've Made

In Topic: Should I try to optimise the World matrix build like this?

16 October 2014 - 03:47 PM

I don't even use scaling (i don't need it at runtime for my project), as for translation and rotation i just compose into one matrix from vector and quaternion, and this is done only for "dynamic" objects since i have lot of static objects (where world is identity) so i can skip lots of unnecessary world*view*proj (so i have just one view*proj for all of those).

In Topic: Raycasting

05 October 2014 - 10:20 AM

What is the problem? You have many examples within their sdk.


Main part is :

    btCollisionWorld::ClosestRayResultCallback result(from, to);
    physicsWorld->rayTest( from, to, result );
... //  use result here

In Topic: PBR (blurry reflections)

13 September 2014 - 08:33 AM


I thought it was only relevant on old nvidia FX series, so it makes a difference on mobile devices too.

In Topic: Light - Dot function

12 September 2014 - 04:15 PM

As kauna said you need to normalize light vector and normal of the surface to get reasonable result from dot product (-1, 1) and then use saturate to get value (0, 1) so you can scale your diffuse color (0 - 100%) based on light/normal orientation, on top of that ambient color should be uniform from all directions so you might want to add it instead multiply, something like:

float3 diffuseMap = txDiffuse.Sample(...);
float3 LightDir = normalize(PosD);
float3 Normal = normalize(In.Normal);
float3 LighD = float3 (0.5f, 0.5f, 0.5f);
float3 LighA = float3 (0.2f, 0.2f, 0.2f);
float NdotL = saturate(dot(Normal, LightDir));
FinalColor.rgb = (NdotL * diffuseMap * LighD) + LighA;

In Topic: PBR (blurry reflections)

12 September 2014 - 01:42 PM

Sorry to interrupt into your thread.

I have one question, what is your reasoning for using half instead of float?