Comments (7)
これは以下のような、レンダーテクスチャとアルファブレンドの問題だと思います。
https://qiita.com/luckin/items/43a8a98a88a3ba20e92b
解決方法は以下のようになります。
- Render Target(Render Texture) を (0.0, 0.0, 0.0 1.0) でクリアする
- Render Texture 描画時の Blend State を以下のように設定する
SrcBlend = D3D11_BLEND_SRC_ALPHA
DestBlend = D3D11_BLEND_INV_SRC_ALPHA
BlendOp = D3D11_BLEND_OP_ADD
SrcBlendAlpha = D3D11_BLEND_ZERO
DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA
BlendOpAlpha = D3D11_BLEND_OP_ADD
- Render Texture をデスクトップへ描画する際の Blend State を以下のように設定する
SrcBlend = D3D11_BLEND_ONE
DestBlend = D3D11_BLEND_INV_SRC_ALPHA
BlendOp = D3D11_BLEND_OP_ADD
SrcBlendAlpha = D3D11_BLEND_ONE
DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA
BlendOpAlpha = D3D11_BLEND_OP_ADD
from saba.
アドバイスありがとうございます。あなたが提案したのはdx11のそのバージョンで、私はあなたが言った通りに変更しても元の問題です(上で述べた2つの問題と違い、上の問題はglfw sampleとsaba_viewerの存在する小さな問題です)。dx11とglfwの2つのsampleを試したんですが、枠と背景色を抜いてアルファブレンドするとおかしいです。これはdx11の問題です:
あなたにたくさんの質問をして申し訳ありませんが、本当に解決したいです。
from saba.
glfw の GLFW_TRANSPARENT_FRAMEBUFFER を使用しているみたいですね。
以下のように描画すればうまくいくかもしれません。
- FBO Texture へモデルを描画する
SrcBlend = SrcAlpha
DestBlend = InvSrcAlpha
SrcBlendAlpha = Zero
DestBlendAlpha = InvSrcAlpha - 画面に、1で描画した Texture を描画する
Blend を OFF に設定し、シェーダーで、
Color = SrcColor / (1.0 - SrcAlpha)
Alpha = (1.0 - SrcAlpha)
として描画する。
今度、自分でも試してみます。
from saba.
ありがとうございます。確かにglfwのGLFW_TRANSPARENT_FRAMEBUFFERです。貴重なご提案ありがとうございます。何とかして、この問題を解決できるように頑張ります。私はコンピュータ関連の専門ではないので、この問題は私にとって難しい。時間とエネルギーがあれば試してみても、無理をする必要はありません。でも、後期の更新を楽しみにしています。
from saba.
@WLiangJun
glfw のサンプルに透明ウィンドウのオプションを追加しました。
888549e
simple_mmd_viewer_glfw -option -model -vmd
from saba.
ありがとうございます。ちょっと試してみましたが、あなたの助けで、ついにその二つの問題を解決しました。お忙しい中、わざわざcodeを修正していただきありがとうございます。
from saba.
解決できたとのことでよかったです。
from saba.
Related Issues (20)
- Can I use mingw or msys2 to cross compile it on linux HOT 1
- how to setup glfw and bullet on windows HOT 1
- can't find gl on windows with msys2 HOT 3
- I wrote a page about how to build with msys2 HOT 1
- Issue in reading PMXModel HOT 1
- Link expired HOT 1
- how to render animation? HOT 5
- Segfault when loading model HOT 8
- how to build it with vcpkg install lib HOT 1
- Bug in loading bone morph data
- how to export the pmx and vmd to fbx? HOT 2
- Can the world coordinates of human skeleton be extracted for each frame according to vmd and pmx files HOT 1
- What to do without CMakeLists.txt in GLFW
- What to do without CMakeLists.txt in GLFW HOT 1
- When I generate an xcode project with cmake and build using that project, it crashes at runtime.
- Cmake compilation failed HOT 1
- The name of the struct is misspelled. HOT 4
- Provide windows build
- If I want to save and download the rendered video, what should I do? HOT 2
- Kotlin Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from saba.