2013-08-28 GLSL : よくあるミス プログラミング OpenGL この記事は GLSL : common mistakes - OpenGL.org - http://www.opengl.org/wiki/GLSL:common_mistakes の勝手な和訳である。和訳したので、ブログのネタもないし公開します。ライセンスとか原文に載ってなかったけど多分大丈夫です。 以下の記事はOpenGL Shading Language, GLSLでよくあるミスについて書く。 目次 Uniform変数 glUniform の使い方 glUniform が動かない glGetUniformLocation と glGetActiveUniform glUseProgram Uniform変数の名前はシェーダステージを超える その他 有効にするかしないか テクスチャのバインド NVIDIA
Rich Geldreich's Blog: Things that drive me nuts about OpenGL Valve社員のRich Geldreichが、OpenGLの設計が古臭すぎることについて不満を爆発させている。 OpenGLについてムカつくことを脳内ダンプしてみる(これは個人的な件秋であって、Valveや同僚の見解ではない。あと、ここ数年、OpenGLと格闘してきたので、今日は機嫌が悪い)。これを投稿する理由はこうだ。GL APIには再設計が必要だ。というのも、思うに、MantleやD3D12がどうせ昼飯前にOpenGL APIを駆逐してしまうだろうから、この問題については、今考える必要があるのだ。 ここに見れば些細な問題もある。単にAPIのトレースの問題というのもある。しかし、それらの問題が積み重なって、他の開発者にGL APIという環境に飛び込むよう誘うのを躊
OpenGLにわりと新しく入った機能でテクスチャー・バッファー・オブジェクト(TBO)というものがある。 これが非常にわかりにくい機能で過不足なく明快に説明した文章を見たことがない。 まずTBOはテクスチャーバッファーという名前のオブジェクトではなく、 2Dテクスチャーやキューブテクスチャーなどのテクスチャーの1種である。 つまりTBOオブジェクトではなくTBOテクスチャーである。 通常の2Dテクスチャーが2次元の画像データから値を拾ってくるのに対して、 TBOは汎用のバッファーオブジェクトから値を拾ってくるテクスチャーである。 Texture・2Dの連想でTexture・BufferObjectと名前を付けたのだろうが、激しく誤解を受けそうなネーミングである。 素直にBufferObject・Textureにしておけばいいのに。。。。 GLSLの中では通常の2Dテクスチャーはsample
Graphics from www.interfacelift.com: Splash by Richard Mohler Bisti Badlands by Ben DiAnna Lazy Days II by boss019 Flamingos by Jestrella Treetops - Michaux State Forest by Se7en The Road To Bonneville by Chris F Clouds Over Water by DerekProspero Starry Night by ManiDProductions Mt Rainier from Kerry Park by Jeffery Hayes Moon Rise by Phil2001 Death Star by unknown (google search) Thanks to: Alex
なにやらあらぬ誤解が広まっている(?)ようなので書いてみる。 何かというと、iPhoneではアルファブレンディングがおかしいんじゃないか、という話。 もちろん全くそんなことはないんですが、恐らく全ての元凶はこれ。 image = [UIImage imageNamed:@"Sprite.png"].CGImage; width = CGImageGetWidth(image); height = CGImageGetHeight(image); data = (GLubyte *) calloc(width * height * 4, sizeof(GLubyte)); context = CGBitmapContextCreate(data, ..., kCGImageAlphaPremultipliedLast); CGContextDrawImage(context, ...); C
OpenGL FAQ http://www.opengl.jp/oglfaq/ ディスプレイリスト int call_list = glGenLists(1); glNewList (call_list, GL_COMPILE_AND_EXECUTE); glColor3f(0.0f, 0.0f, 1.0f); glBegin(GL_LINES); glVertex2f(x + 20, y + 20); glVertex2f(x + 40, y + 40); glEnd(); glBegin(GL_LINES); glVertex2f(x + 40, y + 20); glVertex2f(x + 20, y + 40); glEnd(); glEndList(); glCallList(call_list); Q. OpenGLの描画の出力先をディスプレイ
文字のレイアウトとutf8からunicodeへの変換はcairoに任せられる。 #include <iostream> #include <cassert> #include <ft2build.h> #include FT_FREETYPE_H #include <cairo-ft.h> class FreeType { FT_Library library_; FT_Face face_; int error_; public: FreeType(const char *file, int index=0) { error_=FT_Init_FreeType(&library_); if(error_){ return; } error_=FT_New_Face(library_, file, index, &face_); if(error_){ return ; } } ~Free
OGLFT: OpenGL-FreeType Library 0.8 (perhaps pronounced oh'ghoul-foot) Table of Contents Introduction FeaturesExamplesDemosTutorialTo Do...Miscellaneous Programming NotesOther Software Introduction This C++ library supplies an interface between the fonts on your system and an OpenGL or Mesa application. It uses the excellent FreeType library to read font faces from their files and renders text stri
The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X,
It is very likely that at one point you will want to draw text with OpenGL. It may seem like a very basic functionality of any drawing API, but you will not find any function in OpenGL that deals with text. There are good reasons for that: text is much more complicated than you think. If you are American and use a fixed-width font, then life is simple. You don't have more than 128 possible charact
So here's a quick tutorial to show you how to use the FreeType version 2 font rendering library in OpenGL. By using the FreeType library we can create anti-aliased text that looks better than text made using bitmap fonts (as in Lesson 13). Our text will also have some other advantages over bitmap fonts - it will be easy to rotate and works well with OpenGL's picking functions. Note: This tutorial
prev: http://d.hatena.ne.jp/mjt/20130421/p1 ソフトウェアレンダリング vs. スプライトを使用したポリゴン 今でこそ、PCや携帯電話には3Dレンダリングのためのハードウェアを搭載するのが普通だが、昔はそんなことは無いのでCPUで頑張って絵をレンダリングする"ソフトウェアレンダラ"がかなり制作された。 以下のリストは全然網羅的でない。ソフトウェアレンダラは内製ライブラリとして作られることが多く、あまり外部にライセンスされたりしないので系譜を作るのが難しい。 フラット"多角形"レンダリング いわゆる3Dゲームの黎明期はフラットシェーディングなレンダリングが多く用いられた。例えば、Star foxのようなSuperFXチップなポリゴンゲームもここに分類される。(SuperFXチップはただのRISCプロセサで、点をセットする以外にグラフィックスのための専
最近研究のプログラムを全面的に書き直して整理しているのですが、どうせなら根本から変えてしまおうということでOpenGL系のライブラリについて調べてみました。役に立つかどうか分かりませんが個人的感想など(解説にあらず)をメモとしてここに残しておきます。付け焼き刃の知識なので間違いもあると思います。ご注意を。 ■マルチプラットフォーム化 折角OpenGLで作るんですから、WindowsでもMacでもLinuxでも動くものにしたいですよね。 つーわけでウィンドウなどOS依存の処理をマルチプラットフォーム化するライブラリをご紹介。 -GLUT 定番中の定番。OpenGLを勉強したい方は、まずGLUTによる「手抜き」OpenGL入門を見て勉強しましょう。 私の研究はGLUTでプログラムを組んで、Linuxでコンパイルし直して実行していました。 GLUTによる「手抜き」OpenGL入門をはじめとして資
OpenGL OpenGL reference http://www.opengl.org/sdk/docs/man/ GUI libraries AntTweakBarがOSX対応になってた! GUI Library API Platform Language License 備考 GLUI GL GLUTに依存 C++ LGPL 日本語解説 AntTweakBar GL, DX Mac OSX!, GNU/Linux, Windows (GLFW, SDL, GLUT, DirectXと共存) C/C++ zlib/libpng Glux GL Windows (その他も開発中?) C++ GNU Lesser GPL License v2.1 CEGUI AntTreakBar OSX対応したことだし、GLUTでの使い方をまとめておく。参照: http://www.antisph
移動しました : https://speakerdeck.com/kumaashi/le-siishadertoy Shaderで遊べる楽しいサイト、ShaderToyを勝手に紹介します。 https://www.shadertoy.com/Read less
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く