Jump to content

Recommended Posts

Posted

I would like to draw a image in the skybox cubemap.

But has only a effect when i draw the image at position 0,0

all others has no effect.

 

in function App:Start()

iam create the skybox

--Create skybox
sky = Model:Create()
--just render a plane and project cubemap onto it
local surface = sky:AddSurface()
surface:AddVertex(-0.5,-0.5,0, 0,0,-1)
surface:AddVertex(0.5,-0.5,0, 0,0,-1)
surface:AddVertex(0.5,0.5,0, 0,0,-1)
surface:AddVertex(-0.5,0.5,0, 0,0,-1)
surface:AddTriangle(2,1,0)
surface:AddTriangle(0,3,2)

--position in front of camera but far out to near camera clip plane
sky:SetPosition(self.FPS_CAM:GetPosition())
sky:SetRotation(self.FPS_CAM:GetRotation())
sky:Move(0,0,self.FPS_CAM:GetRange().y-50)
sky:SetScale(self.FPS_CAM:GetRange().y*10)
sky:SetParent(self.FPS_CAM)

-- and paint it
skymat=Material:Load("Materials/Sky/myskybox1.mat")
sky:SetMaterial(skymat)



self.skytexture = skymat:GetTexture()
self.FPSbuffer = Buffer:Create(2048,1536,1,0,0)
self.FPSbuffer:SetColorTexture(self.skytexture)

 

in function App:Loop()


self.FPSbuffer:Enable()
self.FPSbuffer:Clear()
self.context:DrawImage(self.sample,0,0)
self.FPSbuffer:Disable()

 

 

there is an extra command to sign in a cubemap?

have seen there is also an extra shader.

 

Shaders \ Drawing \ drawimagecubemap.shader

 

greeting norbert

Posted

hi shadmar,

 

I want to draw in the skybox cubemap in realtime.

 

when i draw to position 0,0 self.context:DrawImage(self.sample,0,0)

 

the green texture is visible but on other coordinates it has no effect.

 

greeting norbert

 

sky1.png

Posted

Hi Dude,

 

I would like generating a second world. with a camera from the second world I want to render in the skybox from the first world.

 

greeting norbert

Posted

Interesting idea. A bit like how in Kerbal Space Program has different render horizons.

 

I remember Klepto made some cubemap reflection code for Leadwerks 2.x that rendered each side of the cube. It was quite efficient as it rendered on face per frame. So it took 6 frames to complete a full update of the cubemap.

 

Take at look at his implementation, may or may not work in LE3 (will need some conversion):

http://www.leadwerks.com/werkspace/blog/16/entry-654-cubemaps-realtime-here-we-go/

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Posted

Hi, In Hammer/Source engine, this is called a 3D Skybox.

 

Here a link to the description:

https://developer.valvesoftware.com/wiki/3D_Skybox

 

This is using RTT to render from a camera a "reduced model" of a little city that is used in the skybox as background as the player move, the other camera is updated so we see the perspective. Was used in lots of Source games including L4D, HL2...

 

So if we can use RTT with LE3 we could theorically render them and use them as texture for the skybox. But this would require more render passes.

Posted

Not sure if that is really required since i think we can already have a real map that is much bigger than the limit of the hammer editor. (if i understand that link correctly)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...