Cube Mapping & UV Layouts - are there rules to follow?
Moderators: winston, another_commander
- Griff
- Oolite 2 Art Director
- Posts: 2482
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Cube Mapping & UV Layouts - are there rules to follow?
Are there any rules that we need to follow when laying out the UV islands on the map so that cube mapping will work or are they placed using the objects normals or something like that? I want to try and enviroment map a cargo pod using a cubemapped starfield texture, so the uv map will mostly be a long strip for all the sides and 2 seperate pentagons for the top and bottom surfaces
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Cube Mapping & UV Layouts - are there rules to follo
There is no UV mapping needed. The map is just projected on the surface from the centre outward, any existing uv map is ignored.Griff wrote:Are there any rules that we need to follow when laying out the UV islands on the map so that cube mapping will work or are they placed using the objects normals or something like that?
But your object must be close to round. I tried to use it on the asteroids as I thought they might be round enough for cube maps. On al the faces that were to far off-angle to the centre, the texture became to much smeared.
I think the only use will be planets were it is superior over the current method because it has not the artefacts near the poles.
Look at the poles of the earth in Google Earth at very close range. There things also go terrible wrong because of their mapping. (I think on their Marsian map, things were even worse)
Last edited by Eric Walch on Fri Jun 18, 2010 9:05 am, edited 1 time in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Griff
- Oolite 2 Art Director
- Posts: 2482
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
oh, that's a bit disappointing that the object needs to be fairly spherical, i was going to try the example here (Cube Environment Mapping - scroll right down to the bottom of the page)
http://www.ozone3d.net/tutorials/glsl_t ... php#part_4
the chrome griff_krait uses the Spherical Environment Mapping example and that looks really streaky alot of the time, i was hoping the cubemapping version would fix that and i could get something like the first few seconds of this video
http://www.youtube.com/watch?v=iCYplQhT3RU
http://www.ozone3d.net/tutorials/glsl_t ... php#part_4
the chrome griff_krait uses the Spherical Environment Mapping example and that looks really streaky alot of the time, i was hoping the cubemapping version would fix that and i could get something like the first few seconds of this video
http://www.youtube.com/watch?v=iCYplQhT3RU
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
The need to be fairly round only applies when you’re mapping the texture onto the object, as does the need for u/v mapping. Environment maps are not mapped to the object geometry, so all that is irrelevant. All that matters is having reasonably relevant surface normals.Griff wrote:oh, that's a bit disappointing that the object needs to be fairly spherical, i was going to try the example here (Cube Environment Mapping - scroll right down to the bottom of the page)
http://www.ozone3d.net/tutorials/glsl_t ... php#part_4
E-mail: [email protected]
Hmm just took a look at your Griff Krait in game, it looks like the environment map isn't even being used, i even changed the 'griff_enviromentmap1.png' texture drastically and noticed absuletly no differance in the ships reflective-ness.Griff wrote:oh, that's a bit disappointing that the object needs to be fairly spherical, i was going to try the example here (Cube Environment Mapping - scroll right down to the bottom of the page)
http://www.ozone3d.net/tutorials/glsl_t ... php#part_4
the chrome griff_krait uses the Spherical Environment Mapping example and that looks really streaky alot of the time, i was hoping the cubemapping version would fix that and i could get something like the first few seconds of this video
http://www.youtube.com/watch?v=iCYplQhT3RU
In fact, it looks like its using the diffuse map as the environment map.
I'm guessing there's something wrong in the shader files.
- Griff
- Oolite 2 Art Director
- Posts: 2482
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
edit: see Erics post below for details of the download link for an enhanced and oolite 1.74 shader fixed version of the oxp
the krait oxp is broken at the moment in oolite 1.74, it needs to have it's texture uniforms listed in the shipdata.plist, so i think the weirdness you're seeing at the moment ADCK is from that.
I had a go last night at fixing this, there's a link to it here:
but this is still a sort of incomplete test version, Eric W has some awesome script ideas planned to go into the oxp, and when he gets those in that's basically the propper version everyone should download when it comes out
the enviroment mapping is only on the 'chrome' variations, luckily it's the one that comes up on the demo screen ship parade
I had a go last night at fixing this, there's a link to it here:
the enviroment mapping is only on the 'chrome' variations, luckily it's the one that comes up on the demo screen ship parade
Last edited by Griff on Fri Jun 18, 2010 3:26 pm, edited 3 times in total.
ah yes, that version you linked works properly.
Now that I get a proper look at it, It think using a diff texture helps, that one you're using with big stars on it its real noticable at the edges that its gettign stretched, so I tried it with a much more subtle texture, and i barely could tell it was getting stretched, here the texture i used:
(its pretty basic just black with noise.)
Now that I get a proper look at it, It think using a diff texture helps, that one you're using with big stars on it its real noticable at the edges that its gettign stretched, so I tried it with a much more subtle texture, and i barely could tell it was getting stretched, here the texture i used:
(its pretty basic just black with noise.)
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Actually, I already merged my additions in your updated version and put it in the "1.74 folder" in my signature. Because of the use of some new 1.74 scripting features it will be needing 1.74.Griff wrote:Eric W has some awesome script ideas planned to go into the oxp, and when he gets those in that's basically the propper version everyone should download when it comes out.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Hi Eric... I tried the Krait oxp from your sig.
Three of them jumped me. It looks good and has very strange lasers... took me by surprise.
Thanks Griff and Eric.
Is it complete? A few of these appeared in the log:
Three of them jumped me. It looks good and has very strange lasers... took me by surprise.
Thanks Griff and Eric.
Is it complete? A few of these appeared in the log:
Code: Select all
[script.load.notFound]: ***** Could not find a script file named griff_krait_fuel_injectors.js.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Its complete, but that line should have been removed as that script is replaced by an other. I didn't realise griff used two templates and I only removed that line in the chrome version.El Viejo wrote:Is it complete? A few of these appeared in the log:Code: Select all
[script.load.notFound]: ***** Could not find a script file named griff_krait_fuel_injectors.js.
A corrected version is now uploaded.
What the new script does is actually remove the fuel-injection capabilities of the ship when you shoot off the fuel-injection subentity
UPS-Courier & DeepSpacePirates & others at the box and some older versions