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 Chat / Weird 3D image issue...?

Author
Message
Chmava
5
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 7th Jan 2019 08:42 Edited at: 7th Jan 2019 09:12
The image use in 2d sprite is different from the 3d cube object one...?

EDIT: the right is a 3d object!



Any answer as to why is appreciated!

Attachments

Login to view attachments
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jan 2019 08:57
Hi. You haven't set the sprite by using setspriteinage command too
Chmava
5
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 7th Jan 2019 08:59
So, I just use photoshop...
Something else happen...

Attachments

Login to view attachments
Chmava
5
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 7th Jan 2019 09:11
What do you mean by setspriteimage command?
Does create sprite not set the default image for 2d sprite?
Also, the right is a 3d cube...
Chmava
5
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 7th Jan 2019 10:47 Edited at: 7th Jan 2019 10:49
So if you use SetObjectTransparency (1, 1)
The second image work as a mask instead of actually overlapping the first image?
How does setobjectimage and setobjectmeshimage actually work?

Do I need some kind of custom shader?
Bengismo
1
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 7th Jan 2019 11:35 Edited at: 7th Jan 2019 11:37
You can use SetObjectAlphaMask(1,1) on the object

Its the same image used in both cases....sprites have alpha transparency enabled by default but 3D objects dont. If alpha is used then all the extra colours in your image are hidden.

The image you have made has all those colours in it but the alpha values are 0. If you were to use SetSpriteTransparency(1,0) you would see the same image on the sprite.

Its not a bug, just a case of the image your using having a lot of rubbish hidden behind pixels with alpha=0.
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jan 2019 11:38
Hi. I'm currently not on agk at this moment in time but will definitely ly take a look a bit later after work for you to see see what it's doing
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 7th Jan 2019 13:21
Hi there . Chmava ...the snippet above and image are the one you are using ? If yes , here it works as it should,but I do not understand what you're trying to do though
I'm not a grumpy grandpa
Chmava
5
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 8th Jan 2019 01:51 Edited at: 8th Jan 2019 02:32
Was trying to overlap multiple image each with its own alpha over the first image texture.
Like this:
SetObjectMeshImage (oid, 1, imgID, 0)
SetObjectMeshImage (oid, 1, imgID, 1)

Instead, it look like the second image mask the first to only display part that is not an alpha?
Was it not suppose to look like an image stack ontop of another image?
If I have to create custom secondary set of image just to be place in texture slot 0... or custom memblock images... it is possible, just stupid and not why you would use an engine in the first place.
But if there is no answer by my tonight, we will go for that.
we just need something like 6 * 8 worth of additional image and ram space for each.
In the document it mention how 0 for diffuse and 1 for normal instead of lightmap.
So we have been using the lightmap function to simulate what we want, a bit ugly.

also, does , SetObjectMeshImage not accept 0 to reset image?
I keep getting an error about it not existing?

Also, how do you fix the line issue between block object?
I can't seem to find the articles about this.

Attachments

Login to view attachments
Bengismo
1
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 8th Jan 2019 10:10
By default AppGameKit uses texture stage 0 as diffuse, texture stage 1 as a light map and texture stage 2 as a normal map. It doesnt just add up the textures in each stage

You have a few options to overlap multiple images. You could make a new image by adding the two images together using a function similar to the one below


This just overlaps two images with alpha and captures them to a new image.

Alternatively, you can mix the two textures using a shader but this is a bit harder if you havent used shaders before?? Using shaders you can apply different images to each texture stage and then add them or subtract them or do whatever you want with them. There have been loads of blend/mix shaders posted on the shader thread.
https://forum.thegamecreators.com/thread/214598

As an example the pixel shader below mixes two images (in texture slot 0 and 1) using the alpha values of each image


If your not familiar with shaders then it might not be the best solution for you and so mixing them into a new image might be easier.

Quote: "SetObjectMeshImage not accept 0 to reset image?"

Thats a good point and it does look to be a bug. as the documentation for the function states "Using an image value of 0 for a particular texture stage removes any assigned image from that stage." except that it wont accept image ID 0. Might be something for Paul to look at.

Login to post a reply

Server time is: 2019-01-17 20:34:40
Your offset time is: 2019-01-17 20:34:40