As the venture in the realm of Shaders and materials you may encounter the odd obstacle. Please post your shader issue for the community to help.

Refraction

Refraction

Postby Shando » 03 Oct 2013, 05:28

Another post in the Material Forum for me :shock:

Now that I'm getting my models to look almost as I want them :D I have come across one small (I hope!!) issue.

How can I get a realistic looking "Crystal" in four different colours (Red, Green, Blue & Yellow)??

I have tried through various modelling programs, but they can't export the Refractive Index bit. I've also checked the Ogre forums and found some stuff, but it was talking of multiple passes, blitting to the buffer etc. and I haven't quite got my head around that yet :|

Any help would be greatly appreciated, as once my models are done I can start building the rest of the game :mrgreen:

Thanks

Shando
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Refraction

Postby SolarPortal » 03 Oct 2013, 14:25

We or you, would have to write a shader to build in the refractive ability. But you may need to pass certain params and properties from code like you mentioned.
We have been planning on implementing the ability to pass properties and values to the shaders from LUA script as the end users obviously don't have access to c++ at the current time.

I have tried through various modelling programs, but they can't export the Refractive Index bit. I've also checked the Ogre forums and found some stuff, but it was talking of multiple passes, blitting to the buffer etc. and I haven't quite got my head around that yet :|


we can already use multiple pass, just as our base materials do. As for blitting to the buffer, you will most likely need access to code, or as stated above; lua scripts.

Its not something we could pull off immediately, but its one of those things that we ourselves would like to do.
The only problem with the with refractive shaders, they can sometimes be very expensive on performance.

Heres a link to a shader version:
http://www.ogre3d.org/forums/viewtopic.php?f=1&t=70919

at the near bottom, there is a cg shader and material. Maybe worth a try if possible

Edit: you could always use a cubic texture and apply that to the material by using cubic_texture instead of texture in the .material file. If the material has custom shaders, then you will need to add the cubemap algorithm to the shader.
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Shaders n Materials

Who is online

Users browsing this forum: No registered users and 5 guests

cron