cubemaps with shaders

Moderator
Posts: 1,140
Joined: 2005.07
Post: #1
I'm making texgen replacements in shaders (since they go bye bye when you start using shaders), and I have every one working but cubemaps. I've looked online and couldn't find anything. Does anyone know the formula used to generate the cubemaps in OpenGL? In case it helps at all, I'm using assembly shaders. (mainly because of their larger support on the Mac)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
Thank you. I'll read through that and see if I can deduce how to replicate it.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #4
In case anybody else wonders what you need, you need to find R, the same as in sphere mapping, then put that in the s, t, and r of the texture coordinate. If you use fragment shaders, you then use TEX with CUBE. (or whatever GLSL equivalent)
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Best strategy for rendering into cubemaps? TomorrowPlusX 7 4,932 Dec 6, 2009 11:53 AM
Last Post: TomorrowPlusX
  GLSL geometry- and multipass-shaders (nogo?) mcMike 3 5,927 May 2, 2008 05:51 AM
Last Post: mcMike
  Enabling OGL fog in shaders kordova 7 5,363 Jul 12, 2006 10:12 AM
Last Post: kordova
  Program for previewing / editing textures & shaders? haxolotl 4 4,636 Jun 7, 2006 12:48 PM
Last Post: ravuya
  Shaders for OpenGL 1.5? Nick 14 6,810 Mar 25, 2006 11:23 AM
Last Post: DanLab