Glass
Re: Glass
Take a look at this FAQ at openGL.org.
You can use both translucent textures and translucent material color attributes to achieve the glass effect you're looking for. So far not so many nice glass effects have been achieved with Ecere yet, and you're most welcome to share with us your findings or screenshots .
Here are some screenshots from the 3D samples: Hoping this inspires you to render some great looking glass
Cheers,
Jerome
When you set a material to be translucent and call ApplyTranslucency() on a Mesh (as indicated in the thread about materials), primitives are broken up and get rendered from back to front Z order. There is also a Display::DrawTranslucency() method which lets you control when the translucent primitives are drawn, otherwise it is drawn when you reset the camera to 'null' on the display (usually at the end of an OnRedraw() method). You can try using this to draw your glass objects in 2 passes following the OpenGL.org's advice above.15.040 How can I render glass with OpenGL?
This question is difficult to answer, because what looks like glass to one person might not to another. What follows is a general algorithm to get you started.
First render all opaque objects in your scene. Disable lighting, enable blending, and render your glass geometry with a small alpha value. This should result in a faint rendering of your object in the framebuffer. (Note: You may need to sort your glass geometry, so it's rendered in back to front Z order.)
Now, you need to add the specular highlight. Set your ambient and diffuse material colors to black, and your specular material and light colors to white. Enable lighting. Set glDepthFunc(GL_EQUAL), then render your glass object a second time.
You can use both translucent textures and translucent material color attributes to achieve the glass effect you're looking for. So far not so many nice glass effects have been achieved with Ecere yet, and you're most welcome to share with us your findings or screenshots .
Here are some screenshots from the 3D samples: Hoping this inspires you to render some great looking glass
Cheers,
Jerome