はじめにこんにちは!3DCGの再勉強中のなたでです! 今まで、次の変換行列の違いをみてきました。 DirectXとOpenGLのビュートランスフォーム行列の違いDirectXとOpenGLの射影トランスフォーム行列の違い本日は変換の最後のビューポート行列の違いを調べてみましょう。ビューポート変換とは、正規化デバイス座標系から、スクリーン座標系への変換となります。前回の講義から、右手座標系・左手座標系という話はなくなっているので、ビューポート行列はDirectX と OpenGL とで同じだと思いますが、どうなんでしょう。 関連記事3DCGの座標系の紹介DirectXとOpenGLの回転行列、回転軸、回転方向DirectXとOpenGLのビューポート行列の定義DirectXのビューポートの設定D3DVIEWPORT9構造体でビューポートの定義をして、SetViewportで設定できるようです
はじめに はじめまして、ドリコムでエンジニアをやっているイシカワと申します。 普段はネイティブアプリケーション向けに共通ライブラリの開発を担当していて、最近はUnity開発にも関わっています。 今年からUnityを日常的に使うようになり、これまで敷居が高かった3Dアプリ開発が自分にとってぐっと身近な存在になりました。 エディタを起動すれば、すぐさま開発に集中できる環境を用意できます。ゲーム開発の民主化、万歳。 しかし、カッコイイ視覚表現を追求しようといざグラフィックスまわりのコードを書き始めると、そこにはマルチプラットフォーム対応によって生まれた落とし穴が潜んでいます。 この記事では、3Dプログラミングの基礎である「座標変換」において、Unity開発者がつまずきやすい問題を紹介します。 数ヶ月前の自分をふりかえり「こんなまとめ記事が欲しかった・・・」という視点で書いてみました。 テーマの都
COLLADAは最近出てきた3Dフォーマットの一つで、有名メーカが協賛している点は 数あるフォーマットの中でも変り種なのですが、野村XXの愛するLightWaveは蚊帳の外です。 というかNewtekの掲示板の書き込みを見ると、なんかどーでもいいよそんなのって雰囲気が漂ってました。 それはともかく、無いものは作ってしまえというわけでPluginを作り始めました。 あまりにもニッチな気がするので、国内に見切りをつけて(?)海外の皆さん向けにこっちのページで公開します。 興味をもたれた方は覗いてやってください。 技術的にどーというもんでもないので、黙々とコードを書き連ねるのみです。 ちょっと困ったバグがあるので修正記事をお待ち下さい(04/12/27) 今回はOBBTreeによる衝突判定をXファイルで使ってみることにします。 といっても、もはや前回でコアの部分は出来てしまっているので、さくっと
[GDC 2018]西川善司の3DGE:DirectX RaytracingにRTX,Optix,ProRenderにRadeon Rays。“レイトレだらけ”の状況をすっきりさせてみる ライター:西川善司 GDC 2018における3Dグラフィックス技術関連で最大のトピックがレイトレーシングであることに疑いの余地はない。そのうち,MicrosoftがDirectX 12にレイトレーシングパイプラインを統合した「DirectX Raytracing」(以下,DXR)と,実際にそれを「Northlight」エンジンに組み込んだRemedy Entertainmentの事例はすでにお伝え済みだ(関連記事,関連記事2)。 Remedy Entertainmentは早くも自社のゲームエンジンにDXRを統合し,その技術デモを披露した RTXベースのレイトレーシング結果サンプル画像 ここで注意したいのは
MicrosoftがGDC2018で、「Raytracing(レイトレーシング)」を活用できるDirectX 12向けのAPI「DirectX Raytracing(DXR)」を公開しました。すでにNVIDIAやAMDもDXRサポートを明言しており、映画製作で使われるCG技術であるレイトレーシングがPCゲームでも活用されることになりそうです。 Announcing Microsoft DirectX Raytracing! – DirectX Developer Blog https://blogs.msdn.microsoft.com/directx/2018/03/19/announcing-microsoft-directx-raytracing/ Microsoft's DirectX Raytracing paves the way for lifelike gaming, th
You can use Visual Studio to debug shadersA program that runs on the GPU. More info See in Glossary in a Unity application on Windows platforms using DirectX 11 or 12. This page contains information on how to do this. Note: If you are using DirectX 12, Microsoft recommends that you use PIX to debug shaders instead of Visual Studio. For information on using PIX on Windows with Unity, see Debugging
ホーム < ゲームつくろー! < DirectX技術編 その69 インスタンシングでモデルを大量発生! 久しぶりのDirectX9技術編。2014.9時点でDirectX11な時代ではありますが、3Dの基礎はDirectX9でも十分に学べます。まだまだ現役DX9(^-^) 3Dのモデルには、例えば主人公クラスのキャラクタのように1点物モデルもありますが、パーティクルやモブキャラ(背景に適当にいるキャラクタ)のように同じ形状のモデルで且つ大量に発生する役目をするモデルもあります。STGも全く同じ弾や敵のモデルが実に沢山出ますよね。またノベルス系やRPGなどで大量に表示するフォント文字は、これ同じ板ポリゴンの形で表示位置とUV(フォントの位置)が違うだけだったりします。このように「同型もしくは似てるモデルを大量に発生する」場合、個々のモデルを1個ずつまともに描画していると大幅にパフォーマンスを
ホーム < ゲームつくろー! < DirectX技術編 その71 深度バッファの精度って? ポリゴンの前後関係を判断する「深度(Depth)」を格納するバッファである「深度バッファ(Depth buffer)」。このバッファは通常目にする事も触る事も出来ませんが、そこに書き込まれている深度がZテストで比較される事で3Dのモデルに「前後の関係」が与えられるため極めて重要です。 深度バッファでしばし問題になるのがその前後を判定する精度です。所詮デジタルな数値ですから無限に細かい精度で前後判定は出来ません。ポリゴンが殆ど密着しているような状態(キャラクタが着ている衣服やGUIの重ね合わせなど)の場合、本当は離れているはずなのに、精度不足から双方のポリゴンの深度が「同じ」と判定され、描画が激しくちらついてしまう事があります。いわゆる「Zファイト」と呼ばれるアーティファクトです。これを避けるには、密
ホーム < ゲームつくろー! < DirectX技術編 その70 完全ホワイトボックスなパースペクティブ射影変換行列 「今更何を?」という題目ではあります(^-^;。パースペクティブ射影変換行列は3Dを描画する時に間違いなく使用する行列の一つです。DirectX9の場合はD3DXMatrixPerspectiveFovLH関数を使うと自動的にそういう行列を作ってくれます。でも、な~んとなくふわふわっとした感じで使っていませんか?また、中身の数字とか式の形を見るも「ん~、まぁ何かやっているんだろうなぁ」と受け流してしまっていませんか?ワールド変換行列よりも実は良く分からずに使ってしまう事が多いこの行列。これって…ブラックボックスで不安な要素でもあります。 そこで本章では、パースペクティブ射影変換行列を丸裸にしてしまいます。似たような事はマルペケのあちこちに散らばっているのですが、ここにぎゅー
2015 - 07 - 12 DrawCall はなぜ重いのか? 「最適化を行うには、DrawCall を削減すると良い」 という事は良く聞きますが、なぜ DrawCall は重いのかという理由が良く知らなかったので調べてみました。 GPU は描画時に何をしているのか、グラフィックス API の振る舞いと、CPU のオーバーヘッドについてまとめます。 ※ OpenGL と DirectX 、あるいはデスクトップとモバイルについては、特に分けていないので留意して下さい。 ■ そもそも DrawCall とは何か GPU を使用して画面に描画する際に呼び出す命令の事 を DrawCall と呼びます。 モデル描画時に設定されるレンダーターゲット( フレームバッファ )の情報やモデルの頂点情報などはこの DrawCall 命令を一つの基準として処理されます。深度への書き込みが有効か無効か、あるい
ホーム < ゲームつくろー! < DirectX技術編 その55 そもそも「w」って何なのか? ローカル座標にある頂点は(x,y,z,w)という4次元のベクトルで定義されます。「w」・・・これ、謎な存在です。しかも、ローカル座標にある状態では、w=1とします。w=1・・・なぜ?どうして0じゃないの?そもそもコレ何?何に使われているの?どうして必要なの?謎な存在の疑問は尽きません。 そこで、この章ではそんな不思議な存在wの値の意義について調べてみたいと思います。 ① wの変化の旅を見てみよう wが実際にどう作用しているのか、実際にローカルから画面に描画されるまでのプロセスで確かめてみるとよ~~くわかります。長い旅に出発です。 まず、ローカル座標にある頂点は、冒頭で出てきたように(x,y,z,w=1)で定義されます。今、この頂点にワールド変換行列を掛け算してみます: 行列中の「m」というのはス
はじめまして、sayuと申します。 今制作しているゲームで、球体にそった移動をさせようとしています。 イメージとしては地球と人間のような関係です。 (3Dです。) 前後左右の移動入力に対し、現在位置からその方向へ移動させたいと思っています。 『その16 オブジェクトを任意の平面に立たせる姿勢制御』と、 掲示板での『クォータニオンでの姿勢』を参考に色々と試したのですが うまくいきませんでした。 そこで、一旦0から考え直そうと思っています。 何か良い方法がありましたら教えて頂けないでしょうか。 よろしくお願いします。 sayuさん、ご質問頂きましてありがとうございます。 返信が遅れまして申し訳ありません。 平面ではなくて球面上でキャラクタを移動させるには少し特別な考え方をする必要があります。 平面の場合、キャラクタが立つ時の足がかりとなる「重力」はワールドのY軸の逆方向になります。球体の場合、
Microsoftが物理エンジンメーカーのHavokをIntelから買収。ライセンス供与は今後も継続 編集部:松本隆一 北米時間2015年10月2日,Microsoftは,公式blogにおいて,Intel傘下のソフトウェアメーカーであるHavokの買収を発表した。Havokの公式Webサイトにも同じ内容の記事が掲載されているが,買収金額など,詳しいことは明らかになっていない。 Havokは,物理エンジンを中核としたミドルウェア「Havok Physics」などの製品で知られる,アイルランドのメーカーだ。同社の物理エンジンは,HaloシリーズやAssassin’s Creedシリーズ,Call of Dutyシリーズなど,600を超えるタイトルで採用されており,Electronic ArtsやAcitivision,Ubisoft Entertainmentなど,多くの大手パブリッシャとライ
2015年7月15日にバージョン1.0が公開され、同日開催された第1回ゲームエフェクト勉強会(株式会社さくらソフト主催。参加者108名)でも話題になった、エフェクトツール「Effekseer」(エフェクシアー)を使ったエフェクトの作成方法を紹介します。普段エフェクト作成やゲーム開発をしない方も、本記事をきっかけにエフェクト作成に興味をもってもらえたら嬉しいです。 今回使うエフェクトツール「Effekseer」 Effekseerは簡単に綺麗なビジュアルエフェクトを制作できるツールです。 Effekseerはゲーム向けの爆発やヒットエフェクトなど様々なエフェクトを制作できるフリーでオープンソースなツールです。 制作したエフェクトは2Dのアニメーションとして出力したり、3Dのエフェクトとしてゲームに組み込んで再生できます。 ランタイムを組み込むことでDirectXやOpenGLを用いたC++の
ドット絵エディタ「EDGE2」、MIDI音楽編集ソフト「Domino」、楽曲などを配布している個人サイトです。 サンプルコードのダウンロード では、まずサンプルコードをダウンロードし、解凍してください。 私はVisual C++6.0でコンパイルしているので、お持ちの方はVisual C++でプロジェクトファイルを開いてください(「effec_04.dsw」をダブルクリックすれば開けます)。 圧縮ファイルに含まれる「effec_04.exe」をダブルクリックし、実行してみてください(何かキーを押すと終了します)。 どうでしょう?画面が切り替わり、写真が波紋のような歪み方をすると思います(謎。 というわけで、今回もサインカーブを使用して画像を歪ませたいと思います。 今回は解りづらいかも さて、今まで演出講座2・3回にてサインカーブを使用して地球を揺らしてきましたが、今回は右の写真のように、写
算出されるyzwの符号に注目です。真のxの符号が+の時は正しく出ていますが、真のxの符号が-の場合は符号が反転しています。しかし、実はこれは問題ないんです。というのは「回転クォータニオンのQと-Qは同じ回転になる」という性質があるためです。時計の回転する長針を正面から見るか裏から見るかの違いでして、同じ回転であるのに違いありません。つまり、4*|x|さえ分かれば良いんです。そして、それはもう先の式で計算してあるではないですか(^-^)v。±の符号の「+」を採用して4*|x|を作ればいいだけです。 ここまでの情報があれば「よしゃー、変換はこれでできたぜ!」と思いたくなります。しかし、実は落とし穴がありまして、もう少し考慮が必要になります。右辺を4*|x|で割る時、xが0である可能性があるんです。例えば回転軸nが(0,1,0)とすると、|x|はあっさりと0になってしまいます。この場合、4*|x
Super Incorrect Translation "The Direct3D 10 System" (2006 Aug. 2)
ホーム < ゲームつくろー! < DirectX技術編 その61 完全ホワイトボックスなスキンメッシュアニメーションの解説 スキンメッシュアニメーションは3Dのゲームの一つの大きな壁であり、一つの憧れ(?)でもあるかなと思います。かつてマルペケでもDirectX技術編その23辺りからDirectXが用意しているスキンメッシュアニメーションの解説を行いました。当時は良く分からない状態からスタートしましたので、解説もまぁ…分かったようなわからないような内容になっております(^-^;。 一通り実装して思ったのは「DirectX9が用意するスキンメッシュの仕組みを使うと本質がわからなくなる!」という事でした。D3DXLoadMeshHierarchyFromX関数を使ってXファイルを読み込むと、D3DXFRAME構造体とID3DXAnimationControllerが何故か出来ていて、アニメーシ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く