Awesomium in 3.9

Expanding and utilizing the engine via C++.
7 posts Page 1 of 1
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Wed Nov 16, 2016 1:58 pm
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
Azaezel
Posts: 385
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Wed Nov 16, 2016 8:48 pm
benbeshara wrote:GetMatrixFromUpVector > Vector is not normalised.


Ran across that one mself: viewtopic.php?f=10&t=314&p=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.
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Fri Nov 18, 2016 11:04 am
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
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Fri Nov 18, 2016 11:08 am
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.
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Fri Nov 18, 2016 11:16 am
Okay, so it looks like *AwManager::findTextureTargetByMaterial(BaseMatInstance *mat) isn't returning a material instance...
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Fri Nov 18, 2016 11:21 am
Because AwTextureTarget::onAdd isn't being called at all
benbeshara
Posts: 12
Joined: Wed Jun 03, 2015 4:03 am
 
by benbeshara » Fri Nov 18, 2016 11:26 am
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
7 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest