[Cogl] Shader and blend string in Mash

Elias Bakken elias.bakken at gmail.com
Wed Nov 19 09:07:51 PST 2014


Hello, list!
I've been struggling for a long time with Mash and how to get a model
looking somewhat natural.
The only way a model will look is either flat shaded or something that
looks like transparent, but not quite..

I have recently extended Mash to also be able to load .STL models in
addition to .PLY since this is going to be used for a 3D-printer UI, but my
limited knowledge of 3D-graphics, shaders and blend strings has caused my
work to come to a halt.

Is there something in the new pipeline API that can cause not visible faces
to be drawn as well as the visible ones by default? If I set backface
culling to 1 (COGL_PIPELINE_CULL_FACE_MODE_BACK is not exposed for some
reason...), then the symptoms disappear, at least for simple model like a
cube, more complex models still have some "transparency", perhaps since
there are faces facing the camera...

Or is there something wrong with the shader:
https://github.com/clutter-project/mash/blob/master/mash/mash-light-set.c#L264

See attachments (hopefully) for with/without backface culling.
Kind regards,
-Elias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20141119/1ccb03ce/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2014-11-19 18:04:46.png
Type: image/png
Size: 27796 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20141119/1ccb03ce/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2014-11-19 18:05:28.png
Type: image/png
Size: 28464 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20141119/1ccb03ce/attachment-0003.png>


More information about the Cogl mailing list