Jump to content

how to render glass & transparency


deniz
 Share

Recommended Posts

Hi everyone,

 

I want to do the following:

define a quad with custom commands (using le-commands like createmesh, createsurface, addvetrex, addtriangle etc)

I want this quad to look like a glass..

I have to be able to set its alpha value (its transparency) dynamically during run-time

 

How can I do this?

 

I have already looked in the traqnsparency tutorial.

I do not want to render refractions, a refraction shader is overkill in my case, since the glass is very thin (windshield of a car)

(the material files are not existing anyway, which was a serious disappointment for me by the way).

 

I just need to draw the glass.

and later I want to apply a normal map to the glass surface.

Link to comment
Share on other sites

Hi everyone,

 

I want to do the following:

define a quad with custom commands (using le-commands like createmesh, createsurface, addvetrex, addtriangle etc)

I want this quad to look like a glass..

I have to be able to set its alpha value (its transparency) dynamically during run-time

 

How can I do this?

 

I have already looked in the traqnsparency tutorial.

I do not want to render refractions, a refraction shader is overkill in my case, since the glass is very thin (windshield of a car)

(the material files are not existing anyway, which was a serious disappointment for me by the way).

 

I just need to draw the glass.

and later I want to apply a normal map to the glass surface.

 

 

You need to assign material with blend=alpha, and then control it color by EntityColor mesh,vec4(1,1,1,alpha), and render transparent meshes in second pass after lighting.

If you don't want to use refractions, why you need normalmap then? For cubemap reflections?

"Better" is big enemy of "good"

Link to comment
Share on other sites

You need to assign material with blend=alpha, and then control it color by EntityColor mesh,vec4(1,1,1,alpha), and render transparent meshes in second pass after lighting.

If you don't want to use refractions, why you need normalmap then? For cubemap reflections?

 

thanks for you answer Aily,

I will try what you said as soon as possible

quickly one more question before I explain the need for normal map:

I guess if I define a diffuse texture with varying A-value, I can get a varying opacity over the surface, right?

 

I want to use the normal map to make the glass look bumpy for simulating the appearance of rain drops & parftially accumulated snow surface (snow will be partially transparent)

to see what I mean with "partially transparent", please refer to my video below where snow is accumulating little by little over the stanford bunny.

I want to replace the bunny with a transparent thin glass and do this in LE of course (not in OpenGL):

http://www.youtube.com/watch?v=yiuNFLUAOms

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...