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.

Newcomers AppGameKit Corner / How to use Normal and Specular maps in AGK?

Author
Message
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 16th Feb 2016 15:34
Hi.

I would like to use normal map and specular map on my 3D objects by using the SetObjectMeshImage() command. The online documentation say it I can place different images in to different stages by using this command, for example stage 0=Diffuse, stage 1=Normal and stage 2=Specular and the shader going to combine the different textures but it doesn't seems to work.

I think it doesn't work because it is not supported by the default shader comes with AppGameKit, if it is the case, could anyone please give me a working shader or link to any documentation, tutorial how to write my own shader that works in AppGameKit?

Thank you.



Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Feb 2016 16:04
It might be the makeup of the actual model that is causing problems. For example, there are 2 main types of model that AppGameKit supports - bone animated and hierarchy. Hierarchy models don't have a skeleton, but the meshes in the model may be linked or even animated - these might be .3DS files that have been converted to .X. The bone animated models rely on a bone structure and vertex assignment.

Typically only the hierarchy models will be able to be textured on a mesh by mesh basis, because each component is a mesh - unlike a bone animated model which involves vertices being assigned to a mesh. In either case, I believe you'd have to use LoadObjectWithChildren. I think that you might get better results by keeping the objects separate, maybe glue them onto bones on another object instead. I'm not sure that the hierarchy style models have enough command support yet, I'd be wary of using them for the time being.
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 17th Feb 2016 10:08 Edited at: 17th Feb 2016 10:10
Thanks for your reply.

On the Steam forum someone did mentioned the shader comes with AppGameKit does not use the images placed in to stage 1 and above but stage 0, so we need to write our own shaders to get it working.

I have tried with animated and non animated models and with all kind of formats also LoadObjectWithChildren() but nothing works. If I place images in to stage 1 and above, it doesn't work, only stage 0 works but I can place only a single image in to a stage and I'm using stage 0 for Diffuse.
So do you think, Normal and Specular map placed in to stage 1 and 2 should work out of the box with SetObjectMeshImage()?
I don't need to use any other commands to switch the shader or load a completely different shader?

Thanks.
Survey
15
Years of Service
User Offline
Joined: 2nd Sep 2008
Location: WA Australia
Posted: 21st Feb 2016 08:15 Edited at: 21st Feb 2016 08:22
Light mapping.

Here is my code to light map a scene, it works, however; I can't seem to get the normal texture maps in as well.
Shaders are beyond me, is there a simple 'plug & play' solution?
I am using gile[s] as a light mapper. (2004 Very old but simple to use)

PS: How do I add an image or a video to this post?


Asus T100. Win 8.1 CPU Z3775. AppGameKit V2 2.0.16
HD Graphics (Bay Trail)

Attachments

Login to view attachments
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 21st Feb 2016 14:19
Thanks. This is great
It seems to me we need to make our own shaders to get normal maps working

Login to post a reply

Server time is: 2024-03-28 12:10:21
Your offset time is: 2024-03-28 12:10:21