Jump to content

Realtime "cubemap" reflections


macklebee
 Share

Recommended Posts

I am hacking it by having a different material on each face... effectively creating a "cubemap". Using the framework camera for the buffer renders gives it a nice crystal clear reflection and all of the nice framework effects rendered... but its a fps killer doing 6 faces. For actual use in a game, you could just use a normal camera for the render which will give a greater fps boost. Currently its a lua scripted object model that I can just drop into a scene.

Not necessarily creating a cubemap on the fly, but currently I do not think we have a way to set buffer-created textures to a cubemap face index... at least not with an engine command. Still working on the angle of incidence math to have the reflections move based on the camera... but getting there... :D

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

thanks pixel... the framework render might be too much for useable cubemap since the reflections do not need to be very detailed to give a decent effect. But it could be extremely useable for say a large bathroom mirror? Cleaning up the code for anyone that wants to try it out... granted, still need to incorporate the true angles based on camera position... but thats going to require me to get out my kids old schoolbooks :D

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

well honestly it was just in response to tyler's post which was in response to gilmer's and another person's posts... but actually MG and me had basically already created working cctv screen and camera lua scripted models from 6 months ago... which essentially was just the inverse of what I am doing now.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

well honestly it was just in response to tyler's post which was in response to gilmer's and another person's posts... but actually Marley and me had basically already created working cctv screen and camera lua scripted models from 6 months ago... which essentially was just the inverse of what I am doing now.

 

Oh ok ok, nice stuff man...do you have any major future plans with what you are doing with this?

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Thats really cool macklebee. So basicly said:

 

  1. The cube has 6 cameras which render a scene to a buffer.
  2. Every buffer is stored in a texture.
  3. The texture is drawn on the corresponinding surface of the cube.
  4. * cullfaced surfaces do not get render to a buffer, thus no texture to load on the surface.

Correct me if I am wrong.

Link to comment
Share on other sites

Actually you only need one camera. As for the cullfaced surface... hmmm... that's interesting. Perhaps there is a way to determine if you can see a particular material on one Entity? If so that might help pick up some fps so it doesn't need to actually do all 6 renders each update.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

It is impossible to see more than 3 sides of a cube at once ;) (FROM A SINGLE VIEWPOINT and WITHOUT OTHER REFLECTION -> Just defusing any stupid comments to be made by you know who).

  • Upvote 1

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Have to be careful moving cameras around during a scene when using 3D audio that's parented to it or it's pivot (like for a character). Oddly on some systems it can (not always) produce sound clipping/clicks and other audio artefacts.

 

I've taken to having an "fx" cam that's hidden until needed.

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

It is impossible to see more than 3 sides of a cube at once :) (FROM A SINGLE VIEWPOINT and WITHOUT OTHER REFLECTION -> Just defusing any stupid comments to be made by you know who).

Voldemort?

 

that guy is everywhere...

 

yeah, i was curious if anyone knew if it was possible to tell if a particular surface/material was visible thru something like entity culled/visible, but it doesn't look like those work. perhaps a pick would be doable... and that might remove the need for pivots since you can get the normal from the picked surface... but then how do you guarantee the pick will pick up all three faces no matter what?

 

Have to be careful moving cameras around during a scene when using 3D audio that's parented to it or it's pivot (like for a character). Oddly on some systems it can (not always) produce sound clipping/clicks and other audio artefacts.

 

I've taken to having an "fx" cam that's hidden until needed.

 

yeah, i played around with it a little using a second camera which is what we used for a cctv screen... but never had the problem with sound... but i assume your sound setup on your game is alot more intensive than what i have...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...