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.

Author
Message
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 21st Dec 2014 20:54
How can I take the images from my game to make a cubemap? Do i have manually to point the camera up,down,left,right,front,back and using Photoshop to make the final cubemap? there is a particular value of FOV which i need to use when i have to do this?
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 22nd Dec 2014 13:07
You could use the native SET CUBE MAPPING ON function with the parameters: Object Number, Face1, Face2, Face3, Face4, Face5, Face6

Each face parameter represents your 6 images which should give you the textures you need to save them accordingly and import into photoshop.

Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Dec 2014 19:20
looking at the darkbasic example and description, seems like with this command you already have the textures ready to use, the problem is that i need to "make" the textures from my game's world.
If is not like this can you make me a little code example to understand how can I take the textures and save them?
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Dec 2014 19:24
Quote: "how can I take the textures and save them?"


Just use six cameras, one for each face and direction, then use set camera to image, etc.



Powered by Free Banners
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Dec 2014 19:27 Edited at: 22nd Dec 2014 19:28
So exactly as I was saying in my 1st post, perhaps easier to use just 1 camera and rotate it
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Dec 2014 22:25
Yes you can. So what's the problem exactly?



Powered by Free Banners
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 22nd Dec 2014 22:43
I thought there was a faster way to do that, also i am not sure if the FOV will affect somehow the cubemap, i mean, to take the Whole landscape around the camera I have to set the FOV to a certain value so that every part is covered? For example 90 degrees for each image, would cover a total of 360 degrees which is the Whole landscape, Am I right? I have to set FOV to 90 when i do this?
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Dec 2014 12:33
Quote: "I have to set FOV to 90 when i do this? "


Yes. I think you also need to set the aspect ratio to 1.



Powered by Free Banners
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 31st Dec 2014 20:33 Edited at: 31st Dec 2014 20:34
Quote: "looking at the darkbasic example and description, seems like with this command you already have the textures ready to use"


Yep, I missed that part, sorry; getting confused with this and another cubemap function (Dark Shader's version which I do not know how to save to file). Follow GG's method.

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Dec 2014 20:57
Quote: "Dark Shader's version which I do not know how to save to file"


Yes, that is a very annoying limitation, mainly because it ought to be easy to do using the appropriate function from the DX9 library.



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 31st Dec 2014 23:38
Take a look at SET CAMERA TO IMAGE

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 00:07
Quote: "Take a look at SET CAMERA TO IMAGE"


Care to elaborate?



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Jan 2015 00:13
should speed up the process, and also allow real time updating, ideally with a timer and low resolution cubemapping for performance...

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 01:08
Which process? How do you think it's being done now?

The Dark Shader dynamic cube mapping commands also do it behind the scenes. But the question is: how do you save the image?



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Jan 2015 01:51 Edited at: 1st Jan 2015 01:56


Crude but works...

DDS = 3MB PNG = 6~7KB

EDIT

Don't have time to work out how to return the camera back to active bitmap, know how but forgot...

But if you keep hitting spacekey and have the folder open in the background with the PNG highlighted and preview pane open, you will see it is still actively rotating and updating...

Just make six cameras, set their FOV, position them at the same point or in a cubic manner with fixed spacing apart from each and point them in all six directions, and one by one save the images...

You can thank my Codictionary for this quick lookup

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 12:47
Quote: "Crude but works"



No it doesn't. Where's the cube map? In your edit you've suggested taking six different images using set camera to image which is exactly what was discussed earlier. But where have you combined them into a single cube map?

I'm rather confused about the point you're trying to make.



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Jan 2015 13:13
GG are you trolling?

I am not writing it for you, I have my own hurdle to get through right now

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 13:40
Quote: "GG are you trolling?

I am not writing it for you"


Far from it. I just think you've got hold of the wrong end of the stick here.



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Jan 2015 13:43
Hehe, well as I wrote earlier, just repeat for additional cameras and stage those images to the respective cubemap stages

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 16:03
Which is precisely what Chris Tate and I were getting at in our first posts on this thread.



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Jan 2015 16:06
Saving? Save what though? I already shared saving camera images...

Can you clarify your issue?

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 23:13 Edited at: 1st Jan 2015 23:17
Yes indeed. You can't easily save a cube map image from DBPro. A cube map texture has six layers corresponding to the six images we've been discussing and the standard format is the DDS file format. I attach an example to this post found lurking in my DBPro media folder. You can see the six layers by opening it in the DirectX Texture utility "DxTex.exe" - or by texturing a sphere etc with it and using a shader with it.

Such cube maps are sometimes known as environment maps and are often used for texturing the inside of a sky box or sphere so that whichever way you look you see a seamless background of distant hills, sky, ground, etc. They can also be used for providing dynamic reflections of the environment surrounding an object which I assume is what is required here. There are other ways of applying six images to a surface by combining them into a single layer but I find the DDS method both intuitively simpler and easier to work with.

Edit Forgot to add that such cube maps can be loaded into DBPro by using the texture flag 2 in the load image command. All that's missing is a simple means of saving them as well. The same applies to volume textures. In each case you need to code the details yourself which is messy.



Powered by Free Banners

Attachments

Login to view attachments
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st Jan 2015 23:22
Well at least there is a neat way to save a reflection view, what about those RGB values in that command I mentioned earlier?

Oh well, wait for the OP to post back lol

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Jan 2015 23:39
Quote: "what about those RGB values in that command I mentioned earlier?"


Are you referring to the different DDS formats available in the set camera to image command? If so, then those refer to the pixel format not whether it's a standard texture, cube map texture or volume texture. Each of those three types of texture can use any one of the pixel formats which is one of the things specified in the DDS file header.



Powered by Free Banners
Cescano
10
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 2nd Jan 2015 00:38
all what I need is taking the 6 images from a specific spot in my world, and saving them, i can blend them in a single image file manually so it's not that the problem, and I don't need it in real time (i think it would eat several fps), so even if my character goes close to a metallic fence and don't get reflected i don't care, but i need that the metallic fence reflects plus or minus what the fence has around (with the 6 images saved and blended to 1, so not in real time).
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Jan 2015 00:40
Thanks for clarifying that.



Powered by Free Banners
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 2nd Jan 2015 00:45
In that case, use my method above for a try-out, use 128,128 resolution mapping and you should get what you need, somewhat...

Might want to make the images semi transparent too...

Experiment, it is what Programming is all about!

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd Jan 2015 13:43
Quote: "Experiment, it is what Programming is all about!"






Powered by Free Banners

Login to post a reply

Server time is: 2025-05-12 13:05:55
Your offset time is: 2025-05-12 13:05:55