Page 1 of 1

Awesomium in 3.9

Posted: Wed Nov 16, 2016 1:58 pm
by benbeshara
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)

with

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?

Thanks,
Ben

Re: Awesomium in 3.9

Posted: Wed Nov 16, 2016 8:48 pm
by Azaezel
GetMatrixFromUpVector > Vector is not normalised.
Ran across that one mself: http://forums.torque3d.org/viewtopic.ph ... 2658#p2658. fix this end was:

https://github.com/GarageGames/Torque3D ... .cpp#L1633 to

Code: Select all

// 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/Torqu ... ll/1/files rolled in from his latest? **

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

Re: Awesomium in 3.9

Posted: Fri Nov 18, 2016 11:04 am
by benbeshara
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 :)

Thanks,
Ben

Re: Awesomium in 3.9

Posted: Fri Nov 18, 2016 11:08 am
by benbeshara
It looks like AwTextureTarget::getTexture() is never called :/ and neither is AwContext::copyToTexture()
I think the problem may either be in AWShape or perhaps the way Torque maps texture targets has changed? I'll keep looking into it.

Re: Awesomium in 3.9

Posted: Fri Nov 18, 2016 11:16 am
by benbeshara
Okay, so it looks like *AwManager::findTextureTargetByMaterial(BaseMatInstance *mat) isn't returning a material instance...

Re: Awesomium in 3.9

Posted: Fri Nov 18, 2016 11:21 am
by benbeshara
Because AwTextureTarget::onAdd isn't being called at all

Re: Awesomium in 3.9

Posted: Fri Nov 18, 2016 11:26 am
by benbeshara
Okay! The black screens were my fault, the targets.cs file wasn't executing. All running smooth now! Thanks for the help Azaezel, I feel like I've wasted peoples time now lol