Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Trouble applying normal map to object

Author
Message
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 19th Mar 2020 01:19
I have the 3d object asset pack and am trying to load in a few of the assets. Example code loading the bigasteroid.x model


When this program executes, I get the error

When I leave out the SetObjectNormalMap command, the program runs just fine.

AGK Classic 2019.12.16
ACER Nitro AN515-54 laptop
Intel Core i5-9300H
8GB RAM
NVidia GeForce GTX 1050 3GB
Mesher
User Banned
Posted: 19th Mar 2020 01:27
could you send that line that you have in PS file.

There was something AppGameKit didnt like High Precision, i just need to remember what it was...set to a medium float maybe im not sure..





Mesher
User Banned
Posted: 19th Mar 2020 01:31
varying highp vec2 uvVarying;
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Mesher
User Banned
Posted: 19th Mar 2020 01:54
Then again - i dont see any of your shader language - it maybe internal AppGameKit shader language issue with your normal map image - try make it a power of.

16x16
32x32
64x64
128x128
256x256
etc
etc


TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 19th Mar 2020 07:57
The image is 256x256. It is the bigasteroid.x asset from the AppGameKit 3d Asset Pack, which should work as is with AGK. have the same problem with the smallasteroid.x and littleasteroid.x. Haven't tried any of the other models.
The shader would be whatever is generated by AGK.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 19th Mar 2020 09:55
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Mar 2020 09:58
Sounds like uninstalling and reinstalling might be a good idea
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 19th Mar 2020 11:39
Uninstalled, reinstalled, same problem.
If I use SetObjectMeshImage and SetObjectMeshNormalMap instead of SetObjectImage and SetObjectNormalMap, then it works fine.
TomToad
6
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 19th Mar 2020 15:11
Ok, SetObjectMeshNormalMap doesn't always work. After checking the .x files in notepad++, I discover that the 3 asteroid models are made up of 2 meshes. One called __DEFAULT and one called FIRESPOT. The FIRESPOT mesh does not have any uv coordinates set and I think that is what is tripping everything up. As long as I only apply the normal to the __DEFAULT mesh, then everything works.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 19th Mar 2020 16:30
Using your code "As-Is" and I get an error... not just in AppGameKit v2 but also AppGameKit Studio... it's a nearly identical error about uvVarying being unidentified and unable to convert temp float to temp highp 2-component vector of float
... mind unlike you, I'm getting that error with both the Object and Mesh NormalMap Functions.

Why there is this issue... I can't be sure, but I think it has something to do with the DirectX Object itself... which is in the archaic ASCII .X Format.
Now a big issue is, there isn't much nowadays that'll actually Import it (the Blender .X Importer is Binary Format only).

You will get it working with:
Default.Normal.glsl


Default.Pixel.glsl


They're just the Default Shaders that would normally be generated... not sure why they're failing with this model.
Still you can just manually load the shaders and everything ends up fine.

Mind, as a point of note... the Vertex Normals are going to cause either some Faceted Lighting or Lessen the Normal Effect.
You'll probably want to either recalculate the Normals (via Memblocks) or export to a common universal format (like OBJ for example).
I am in the midst of an OBJ Format Importer / Exporter for a current project, so I'll see about making a Stand-Alone Version at the same time ... as A LOT of the TGC Assets really should be in FBX Format.
It made sense with DarkBASIC Professional to stick with .X because FBX at the time was still quite new, but it's been 15 years; the only other Formats that have had the same longevity is OBJ and DAE ... and frankly that's only because of CAD.

It's also weird how they dropped support for DDS (DXT), despite those formats merely being Microsoft Branded, Binary Colour Compression 1, 4, 5, 6 and 7.
AMD had Open Libraries for said Formats that are essentially "Out-of-the-Box" Usable from their Media SDK.

Login to post a reply

Server time is: 2024-11-22 04:53:11
Your offset time is: 2024-11-22 04:53:11