specular lighting refraction demo

This topic contains 9 replies, has 2 voices, and was last updated by  john lam 4 years, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #31251

    john lam
    Member

    Hi I was trying to add specular lighting to my project however as I was reading through your refraction demo code I came across this

    vLightDirModel = mModelView.inverse() * PVRTVec4(0.57735f, 0.57735f, 0.57735f, 0);

    and was wondering how you got the values within the PVRTVec4?

    #37187

    dgu
    Member

    the light diffuse color can be set in PVR SHAMAN or you can take the color of the diffuse Omni in 3ds max
    the model inverse matrix enable to get back the vector in world pos

    #37188

    john lam
    Member

    so the PVRTVec4 is for colour? rather than the position or direction of the light?

    #37189

    dgu
    Member

    R,G,B,ALPHA ( OPACITY)
    what represente the mModelView from your point of view ?

    #37190

    john lam
    Member

    I see thanks, I tried to put that code into my project however I get nothing. I shall take another look at my code

    #37191

    john lam
    Member

    are you asking what my mModelView is in my project? or asking my from my perspective what mModelView is in general?

    #37192

    dgu
    Member

    in your project

    #37193

    john lam
    Member

    oh right

    PVRTMat4 model;
    model = PVRTMat4::RotationX(-90);
    PVRTMat4 mMVP, modelView;
    modelView = view_Mat * model;
    mMVP = proj_Mat * modelView;

    and my view matrix is manually defined

    view_Mat = PVRTMat4::LookAtRH(PVRTVec3(0, 0.5, 3), PVRTVec3(0, 0, 0), PVRTVec3(0, 1, 0));

    #37194

    dgu
    Member

    Hi I was trying to add specular lighting to my project however as I was reading through your refraction demo code I came across this

    vLightDirModel = mModelView.inverse() * PVRTVec4(0.57735f, 0.57735f, 0.57735f, 0);

    and was wondering how you got the values within the PVRTVec4?

    the direction is calculated by taking the normal of the light position

    #37195

    john lam
    Member

    ahhh I see now thanks 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic.