norbert Posted January 16, 2014 Share Posted January 16, 2014 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 Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 16, 2014 Share Posted January 16, 2014 What are you trying to do? Nothing in your code makes any sense to me. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
norbert Posted January 16, 2014 Author Share Posted January 16, 2014 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 Quote Link to comment Share on other sites More sharing options...
DudeAwesome Posted January 17, 2014 Share Posted January 17, 2014 Whats the use of that? or why you will draw a big FRONT image into the skybox? Quote It doesn´t work... why? mhmmm It works... why? Link to comment Share on other sites More sharing options...
norbert Posted January 17, 2014 Author Share Posted January 17, 2014 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 Quote Link to comment Share on other sites More sharing options...
Flexman Posted January 17, 2014 Share Posted January 17, 2014 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/ Quote 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 Link to comment Share on other sites More sharing options...
Christian Clavet Posted January 20, 2014 Share Posted January 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
beo6 Posted January 20, 2014 Share Posted January 20, 2014 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) Quote Link to comment Share on other sites More sharing options...
shadmar Posted January 20, 2014 Share Posted January 20, 2014 You can use buffers already, but there is no way that I know of where you can create a cubemap texture under the cuirrent lua api where you can render 6 textures to. Unless there is some setting I don't know about http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/texture/texturecreate-r340 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Recommended Posts
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.