Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Code Snippets

Cheap Reflections

Paste down any little snippets or request a new one.

Cheap Reflections

Postby kalango » 29 Dec 2011, 17:46

Hello community, here is a simple project that i worked for about 2 hours. Its a cheap reflection fx, its composed of a camera render map and a sphere mapping material. You also might want to adjust the projector camera FOV so it can fit your needs better.
It was tested on a PC only, but it should work on any architecture that supports rendermaps.

DOWNLOAD LINK

Feel free to change it, improve it, etc...

PS: some artifacts are spotted if the model is a bit convex like the monkey model included, the camera sees the model polygons and plot them as black artifacts.... Adjusting the camera near plane should do the job.

PPS: If you change "MDL_Sphere" for "MDL_Monkey" in the main AI you will be able to test the example wih the monkey head model.
User avatar
kalango
Gold Boarder
Gold Boarder
 
Posts: 196
Location: Nova Scotia - Canada

Re: Cheap Reflections

Postby ThunderZ » 30 Dec 2011, 00:05

very nice effect :) great share thx.
User avatar
ThunderZ
Platinum Boarder
Platinum Boarder
 
Posts: 429
Location: France - Loiret

Re: Cheap Reflections

Postby broozar » 30 Dec 2011, 22:37

looks nice.
but rendermaps are not cheap! sphere maps are.
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3440
Location: Berlin - Germany

Re: Cheap Reflections

Postby kalango » 02 Jan 2012, 18:30

Thanks!
The "cheapness" is more related to the simplicity of the effect. Also if you see the cubemap technique as rendermap projections into one model, the effect i proposed is definitly way more optimized. Even dual parabloid techniques are heavier than this.

Thaks anyway.
User avatar
kalango
Gold Boarder
Gold Boarder
 
Posts: 196
Location: Nova Scotia - Canada

Re: Cheap Reflections

Postby Dany0 » 16 Jun 2012, 09:20

Ah the link is dead :?
Shiva 2.0.
User avatar
Dany0
Expert Boarder
Expert Boarder
 
Posts: 153

Re: Cheap Reflections

Postby broozar » 16 Jun 2012, 10:11

i believe i still have it somewhere.. will post a new link soon.
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3440
Location: Berlin - Germany

Re: Cheap Reflections

Postby ThunderZ » 16 Jun 2012, 19:41

Here it is ;)
User avatar
ThunderZ
Platinum Boarder
Platinum Boarder
 
Posts: 429
Location: France - Loiret

Re: Cheap Reflections

Postby Dany0 » 16 Jun 2012, 22:16

Tanks a lot :P
Shiva 2.0.
User avatar
Dany0
Expert Boarder
Expert Boarder
 
Posts: 153

Re: Cheap Reflections

Postby Psychopsam » 23 Apr 2014, 12:24

Link is missing :(
User avatar
Psychopsam
Platinum Boarder
Platinum Boarder
 
Posts: 428

Re: Cheap Reflections

Postby kalango » 23 Apr 2014, 17:37

Oh man, i don't think i have it anymore. I believe i lost this file somehow, but it's kind of pretty easy to set up really. It's not as cheap as i thought but here's the deal:

Create a second camera that is attached to the object you want to have reflections (put inside of it or project it onto the object using raycast). The camera should be facing the direction of what you want to reflect, away from the object in most cases. Then you need to get the render output and put it as a sphere mapped texture on the 2nd texture channel of your object's material.
Then you'll just need to set up your camera FOV so it can get the right reflection view angle.

I hope it helps...
User avatar
kalango
Gold Boarder
Gold Boarder
 
Posts: 196
Location: Nova Scotia - Canada


Return to Code Snippets