|
akademiks
|
 |
« on: June 27, 2012, 01:02:09 PM » |
|
I have a really big image (> 4096x4096) that i map to a skydome. My implementation works but on some plateforms (mobile) the image cannot be loaded because its too big. Altought i can load it in separated sub textures and openGL can render those smalled textures. Lets say i separated my big image in 4 sub images (picture 2 rows & 2 cols on the big image source)...Right now i have 1 vertices array (triangle strip), 1 normal array and 1 texture coord array. I guess that I have to generate 1 vertices/normals/texCoord array per sub texture My problem is that i am not sure how to apply the sub images to my dome vertices...
Anyone did that before?
|
|
|
|
|
Logged
|
|
|
|
|
Nix
|
 |
« Reply #1 on: June 27, 2012, 01:16:21 PM » |
|
Why don't you bake the dome to a skybox, and then you don't even have to think about how to split the textures up.
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #2 on: June 27, 2012, 01:34:56 PM » |
|
I was using a skybox before, but the core algorithm of my app is now based (for important reasons) on a dome geometry
|
|
|
|
|
Logged
|
|
|
|
|
Nix
|
 |
« Reply #3 on: June 27, 2012, 03:03:53 PM » |
|
Is the sky dynamic? Otherwise, I sincerely believe there is no reason to have it a dome.
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #4 on: June 27, 2012, 03:52:08 PM » |
|
Its not dynamic but my image is actually made to be wrapped around a dome, the skybox geom creates distortions to my image
|
|
|
|
|
Logged
|
|
|
|
|
rivon
|
 |
« Reply #5 on: June 28, 2012, 02:06:37 AM » |
|
Then convert the skydome to skybox 
|
|
|
|
|
Logged
|
|
|
|
|
akademiks
|
 |
« Reply #6 on: June 28, 2012, 02:31:47 AM » |
|
Lol! I guess ill figure it out by myself
|
|
|
|
|
Logged
|
|
|
|
|
Ashaman73
|
 |
« Reply #7 on: June 28, 2012, 05:10:39 AM » |
|
I have a really big image (> 4096x4096) that i map to a skydome. My implementation works but on some plateforms (mobile) the image cannot be loaded because its too big. Altought i can load it in separated sub textures and openGL can render those smalled textures. Lets say i separated my big image in 4 sub images (picture 2 rows & 2 cols on the big image source)...Right now i have 1 vertices array (triangle strip), 1 normal array and 1 texture coord array. I guess that I have to generate 1 vertices/normals/texCoord array per sub texture My problem is that i am not sure how to apply the sub images to my dome vertices...
Anyone did that before?
I think that this is the wrong way to solve your problem. When the hardware is not able to render a 4096x4096 texture, it will have a hard time to render 4x 2048x2048 [~80-90 mb video memory RGBA , including mipmaps, uncompressed). On the other hand you will see most of the time only the mipmapped version of your texture(assumption: your skydome is roughly a half-sphere and you have a fov of 90, then you see roughly a texture section of 2048x2048, therefore you need at least a screen resolution of 2048x2048 to actually benefit from such a hi texture resolution, and this is quite unlikely on a mobile). Best to provide several downscaled (4096 , 2048 , 1024) version of your sky texture and choose suitable one depending on hardware features.
|
|
|
|
|
Logged
|
|
|
|
|
Nix
|
 |
« Reply #8 on: June 28, 2012, 05:57:28 AM » |
|
Lol! I guess ill figure it out by myself
I don't remember exactly how, but I know it can be done fairly easily in Blender. Search "baking skydome to skybox in Blender" or something like that and you should be good.
|
|
|
|
|
Logged
|
|
|
|
|
rivon
|
 |
« Reply #9 on: June 28, 2012, 06:00:57 AM » |
|
Just create 6 cameras heading in all the main directions (up, down, left, right, forward, backward) with 90 degrees FOV, load the skydome and render the views captured by the cameras. There you have your textures for skybox.
|
|
|
|
|
Logged
|
|
|
|
|
Evan Balster
|
 |
« Reply #10 on: June 28, 2012, 07:12:37 AM » |
|
If this is for iOS you should definitely be careful with memory usage. iOS runs out of memory really fast.
|
|
|
|
|
Logged
|
|
|
|
|
Nix
|
 |
« Reply #11 on: June 28, 2012, 07:14:15 AM » |
|
Just create 6 cameras heading in all the main directions (up, down, left, right, forward, backward) with 90 degrees FOV, load the skydome and render the views captured by the cameras. There you have your textures for skybox.
I think you can just make a box and make the dome around it and then do some magic and the dome texture will be projected onto to the box. No need to even touch a camera.
|
|
|
|
|
Logged
|
|
|
|
|
rivon
|
 |
« Reply #12 on: June 28, 2012, 07:19:11 AM » |
|
I don't know the magic you are talking about but the technique, I presented, works.
|
|
|
|
|
Logged
|
|
|
|
|
Laurent C
|
 |
« Reply #13 on: June 28, 2012, 07:56:43 AM » |
|
Just create 6 cameras heading in all the main directions (up, down, left, right, forward, backward) with 90 degrees FOV, load the skydome and render the views captured by the cameras. There you have your textures for skybox.
I think you can just make a box and make the dome around it and then do some magic and the dome texture will be projected onto to the box. No need to even touch a camera. Rivon is saying use 6 camera on the skydome to generate new textures for a skybox. This works better than just applying the texture to a box because of the perspective distortion.
|
|
|
|
|
Logged
|
|
|
|
|
Nix
|
 |
« Reply #14 on: June 28, 2012, 08:32:19 AM » |
|
What? I don't just mean put the skydome texture onto a box. That would be tremendously stupid. I mean Blender has a way to project the skydome onto the box (i.e. how skyboxes work).
|
|
|
|
|
Logged
|
|
|
|
|