Jump to content

Awesomium in 3.9


Recommended Posts

Hi all,

I've been trying to get Steve Lundmark's Awesomium resource running in T3D 3.9 but I've encountered two problems - Firstly, the shapes don't seem to render anything, they just appear black. Secondly, if I try to interact with the shapes, I error out with a GetMatrixFromUpVector > Vector is not normalised.

Getting the code to compile was trivial - just replacing both instances of

AwDataSource::OnRequest (int id, const Awesomium::WebString &path)


void AwDataSource::OnRequest (int id, const Awesomium::ResourceRequest& request, const Awesomium::WebString &path)

got it compiling beautifully.

Any help with where to get started on this would be great - I'm lost in the code at the moment. I know there's been a lot of rendering changes since T3D 3.5 - could this be the root of the problem?



Link to comment
Share on other sites

GetMatrixFromUpVector > Vector is not normalised.


Ran across that one mself: http://forums.torque3d.org/viewtopic.php?f=10&t=314&p=2658#p2658. fix this end was:

https://github.com/GarageGames/Torque3D/blob/c152ae86f3f09b3c1d736954b352723d274582f1/Engine/source/ts/tsCollision.cpp#L1633 to

         // slerp
        Point3F divSafe = (max - min);
        if (divSafe.x == 0.0f) divSafe.x = POINT_EPSILON;
        if (divSafe.y == 0.0f) divSafe.y = POINT_EPSILON;
        if (divSafe.z == 0.0f) divSafe.z = POINT_EPSILON;

        Point3F s = ( (max - min) - (facePoint - min) ) / divSafe;


On the black screen... sounds familiar... Got https://github.com/StefanLundmark/Torque3D_Awesomium/pull/1/files rolled in from his latest? **

**do note, using a different solution this end, so educated guesses.

Link to comment
Share on other sites

Thanks for the response :)

I'm running against the latest head of 3.9, the GetMatrixFromUpVector error still occurs with the fix applied. The error doesn't occur on release builds, only debug, so I'm wondering if it'll be a big deal - I won't know until I get it working though lol.

I managed to get the AwGUI to render properly by changing &GFXDynamicTextureProfile to &GFXDefaultStaticDiffuseProfile - for my game this is mostly all I need, but I'd still like to help get to the bottom of this for others sake :)



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...