0

SharpDX - Transparency from image

Anonymous 10 years ago updated by manypage 4 months ago 338
This discussion was imported from CodePlex

geoarsal wrote at 2014-03-07 10:05:

Hi,

how can i enable transparency from image for textures ??

In WPF3D, all i need to do is to create the diffuse material with image brush and use it. In SharpDX fork, I had created PhongMaterial and set its DiffuseMap to the same image i used in WPF3D, but here the transparent region are rendered as Black.

Thanks

Rogad wrote at 2014-03-08 16:05:

I used PNG textures. Also read this about how you need to order transparent parts :

http://www.ericsink.com/wpf3d/2_Transparency.html


I still have problems with layered transparency though, when one part of the model overlaps the other it does not look right.

geoarsal wrote at 2014-03-08 17:48:

Thank you Rogad for your reply.

I would like to know have you used PNG textures to attained transparency in "SharpDX fork of Helix Toolkit" ?? because the link you have provided is about transparency in WPF3D but I need transparency in SharpDX.

P.S. I already got the transparency using image texture in WPF3D but I require same functionality in SharpDX fork using that same image.

Rogad wrote at 2014-03-08 17:56:

Sorry I did not realise you were asking about SharpDX. I have not tried it, because I couldn't see how to get support, so gave up on it.

geoarsal wrote at 2014-03-12 19:04:

After debugging the code, I had resolved this issue. Following are the changes I needed to make in Helix SharpDx.


In the pixel shader "PShaderPhong" method, alpha value is taken explicitly from the diffuse material.

Current Code "Default.fx"
/// set diffuse alpha
I.a = vMaterialDiffuse.a;
Fix "Default.fx"
I.a = vMaterialDiffuse.a * vMaterialTexture[3];
Also the conversion of texture map is done through BMP encoder, however apparantly it looks like BMP encoder doesn't support alpha in texture map. Changing bmp encoder to png encoder will resolve this issue.

Current Code "RenderUtil.cs"
public static byte[] ToByteArray(this System.Windows.Media.Imaging.BitmapSource bitmapSource)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                var encoder = new System.Windows.Media.Imaging.BmpBitmapEncoder();
                encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(bitmapSource));
                encoder.Save(ms);
                return ms.ToArray();
            }
        }
Fix "RenderUtil.cs"
public static byte[] ToByteArray(this System.Windows.Media.Imaging.BitmapSource bitmapSource)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                var encoder = new System.Windows.Media.Imaging.PngBitmapEncoder();
                encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(bitmapSource));
                encoder.Save(ms);
                return ms.ToArray();
            }
        }

objo wrote at 2014-04-29 10:57:

I have forwarded this to the guys working on the sharpdx fork.

Rogad wrote at 2014-05-24 18:16:

Is there a similar fix for Helix ?

For my project this is the main area where Helix does not seem to work right.

Despite following various tutorials/guides on transparency, such as putting the transparent textures last I still end up with this :



Some of the transparency is working, but as you can see not all.

Would really like to fix this :)

Rogad wrote at 2014-05-30 16:46:

Anyone ? Objo ? Are you still with us ? :)

objo wrote at 2014-05-30 22:56:

hi Rogad, yes I am following the discussion, but don´t know how to solve this. How are you rendering the hair? Are you using SharpDX or WPF? Can you create a demo application we can include with the library?

Rogad wrote at 2014-05-30 23:08:

Hi :)

I'm using WPF and Helix. I have not used SharpDX for anything yet, I was trying to find some documentation for it or support, but haven't found much yet.

Unfortunately I cannot turn this into something distributable. The models I had to buy from Daz3D and I cannot redistribute them like that.

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

เว็บแทงบาคาร่าออนไลน์

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

เว็บคาสิโนฝากถอนauto

Thank you for all the information.Thank you. Your article is written very well.

เว็บสล็อตฝากถอนauto

So it is interesting and very good written and see what they think about other people.

เว็บแทงบอลฝากถอนauto

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

เว็บแทงบาคาร่าฝากถอนauto

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

เว็บคาสิโนปลอดภัยไม่โกง

Thank you for all the information.Thank you. Your article is written very well.

เว็บสล็อตปลอดภัยไม่โกง

So it is interesting and very good written and see what they think about other people.

เว็บแทงบอลปลอดภัยไม่โกง

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

เว็บแทงบาคาร่าปลอดภัยไม่โกง

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

ทางเข้าเว็บคาสิโนออนไลน์

Thank you for all the information.Thank you. Your article is written very well.

ทางเข้าเว็บสล็อตออนไลน์

So it is interesting and very good written and see what they think about other people.

ทางเข้าเว็บแทงบอลออนไลน์

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

ทางเข้าว็บแทงบาคาร่าออนไลน์

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

สมัครสมาชิกเว็บคาสิโนออนไลน์

Thank you for all the information.Thank you. Your article is written very well.

สมัครสมาชิกเว็บสล็อตออนไลน์

So it is interesting and very good written and see what they think about other people.

สมัครสมาชิกเว็บแทงบอลออนไลน์

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

สมัครสมาชิกว็บแทงบาคาร่าออนไลน์

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

คาสิโนออนไลน์

Thank you for all the information.Thank you. Your article is written very well.

สล็อตออนไลน์

So it is interesting and very good written and see what they think about other people.

แทงบอลออนไลน์

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

แทงบาคาร่าออนไลน์

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

เว็บคาสิโนบนมือถือ

Thank you for all the information.Thank you. Your article is written very well.

เว็บล็อตบนมือถือ

So it is interesting and very good written and see what they think about other people.

เว็บแทงบอลบนมือถือ

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

เว็บแทงบาคาร่าบนมือถือ

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

เว็บคาสิโนฝากถอนไม่มีขั้นต่ำ

Thank you for all the information.Thank you. Your article is written very well.

เว็บสล็อตฝากถอนไม่มีขั้นต่ำ

So it is interesting and very good written and see what they think about other people.

เว็บแทงบอลฝากถอนไม่มีขั้นต่ำ

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

เว็บแทงบาคาร่าฝากถอนไม่มีขั้นต่ำ

Thank you for writing such a useful article. And this is interesting. It's something I never knew before. I'm looking forward to following the next article.

สล็อตออนไลน์

I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys.

แทงบอลออนไลน์

Thank you for all the information.Thank you. Your article is written very well.

เว็บแทงบอลออนไลน์

So it is interesting and very good written and see what they think about other people.

เว็บแทงบอลบนมือถือ

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

เว็บแทงบอลขั้นต่ำ 10 บาท

This article is good, very helpful. Thank you for sharing information. Hope you continue to share this great article. Thank you very much.

เว็บคาสิโนได้เงินจริง

Thanks for the tips guys. They were all great. I have been having issues with being fat both mentally and physically. Thanks to you guys i have been showing improvements. Do post more.
รีวิวเว็บแทงบอลยูฟ่าเบท
เว็บแทงบอลเว็บตรงยูฟ่าเบท รีวิวแทงบอลUFABET

This site is so informational and you guys will not regret it if you visit it! yks777

I can’t thank the creator of this website enough for helping me solve my problem. Thank you and Go check it out! Situs Togel

This blog is very informative and I hope it can help you like it helped me with my problem. Thank you! pussy888

This blog is very interesting and I hope it can help you like it helped me with my problem. Thank you! Slot Depo 10k

Thank you for sharing these insightful information! I also have some useful information that you might be looking for which is in pelatihan k3 umum

I would not know what to do if my friend had not shared this website with me. Go visit it at Slot Gacor

great blog, thanks for sharing good information

tiktik downloader hd

I am so glad that I found this article online. In change, I will direct you to this website that has helped me a lot in the past mawartoto

https://images.google.ro/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.my/url?sa=t&url=https://umbfoundation.org/ https://www.google.co.za/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.sg/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.il/url?sa=t&url=https://umbfoundation.org/ https://images.google.co.il/url?sa=t&url=https://umbfoundation.org/ https://www.google.cl/url?sa=t&url=https://umbfoundation.org/ https://maps.google.ie/url?sa=t&url=https://umbfoundation.org/ https://www.google.ie/url?sa=t&url=https://umbfoundation.org/ https://maps.google.sk/url?sa=t&url=https://umbfoundation.org/ https://images.google.bg/url?sa=t&url=https://umbfoundation.org/ https://maps.google.bg/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.pe/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.pe/url?sa=t&url=https://umbfoundation.org/ https://maps.google.ae/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.pk/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.co/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.co/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.eg/url?sa=t&url=https://umbfoundation.org/ https://maps.google.lt/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.sa/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.sa/url?sa=t&url=https://umbfoundation.org/ https://images.google.hr/url?sa=t&url=https://umbfoundation.org/ https://images.google.ee/url?sa=t&url=https://umbfoundation.org/ https://www.google.si/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.ec/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.ec/url?sa=t&url=https://umbfoundation.org/ https://maps.google.lv/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.ng/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.ng/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.pr/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.gt/url?sa=t&url=https://umbfoundation.org/ https://maps.google.com.gt/url?sa=t&url=https://umbfoundation.org/ https://images.google.co.cr/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.cr/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.uy/url?sa=t&url=https://umbfoundation.org/ https://images.google.com.uy/url?sa=t&url=https://umbfoundation.org/ https://maps.google.lu/url?sa=t&url=https://umbfoundation.org/ https://images.google.lu/url?sa=t&url=https://umbfoundation.org/ https://www.google.lu/url?sa=t&url=https://umbfoundation.org/ https://maps.google.com.do/url?sa=t&url=https://umbfoundation.org/ https://www.google.com.do/url?sa=t&url=https://umbfoundation.org/ https://www.google.co.ma/url?sa=t&url=https://umbfoundation.org/ https://images.google.lk/url?sa=t&url=https://umbfoundation.org/ https://www.google.co.bw/url?sa=t&url=https://umbfoundation.org/ https://plus.google.com/url?q=https://umbfoundation.org/ https://maps.google.com/url?sa=t&url=https://umbfoundation.org/ https://cse.google.de/url?sa=i&url=https://umbfoundation.org/ https://images.google.de/url?q=https://umbfoundation.org/ https://images.google.de/url?sa=t&url=https://umbfoundation.org/ https://maps.google.de/url?q=https://umbfoundation.org/ https://images.google.co.uk/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.uk/url?sa=t&url=https://umbfoundation.org/ https://cse.google.co.uk/url?sa=i&url=https://umbfoundation.org/ https://maps.google.co.jp/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.jp/url?sa=t&url=https://umbfoundation.org/ https://cse.google.co.jp/url?sa=i&url=https://umbfoundation.org/ https://images.google.co.jp/url?sa=t&url=https://umbfoundation.org/ https://cse.google.fr/url?sa=i&url=https://umbfoundation.org/ https://images.google.fr/url?sa=t&url=https://umbfoundation.org/ https://images.google.fr/url?q=https://umbfoundation.org/ https://maps.google.fr/url?sa=t&url=https://umbfoundation.org/ https://maps.google.fr/url?q=https://umbfoundation.org/ https://maps.google.es/url?q=https://umbfoundation.org/ https://maps.google.es/url?sa=t&url=https://umbfoundation.org/ https://images.google.es/url?sa=t&url=https://umbfoundation.org/ https://images.google.es/url?q=https://umbfoundation.org/ https://cse.google.es/url?sa=i&url=https://umbfoundation.org/ https://images.google.it/url?sa=t&url=https://umbfoundation.org/ https://images.google.it/url?q=https://umbfoundation.org/ https://maps.google.it/url?q=https://umbfoundation.org/ https://cse.google.it/url?sa=i&url=https://umbfoundation.org/ https://images.google.com.br/url?q=https://umbfoundation.org/ https://images.google.com.br/url?sa=t&url=https://umbfoundation.org/ https://cse.google.com.br/url?sa=i&url=https://umbfoundation.org/ https://maps.google.com.br/url?q=https://umbfoundation.org/ https://maps.google.com.br/url?sa=t&url=https://umbfoundation.org/ https://maps.google.ca/url?sa=t&url=https://umbfoundation.org/ https://cse.google.ca/url?sa=i&url=https://umbfoundation.org/ https://images.google.ca/url?sa=t&url=https://umbfoundation.org/ https://cse.google.com.hk/url?sa=i&url=https://umbfoundation.org/ https://images.google.com.hk/url?q=https://umbfoundation.org/ https://images.google.com.hk/url?sa=t&url=https://umbfoundation.org/ https://maps.google.com.hk/url?q=https://umbfoundation.org/ https://maps.google.com.hk/url?sa=t&url=https://umbfoundation.org/ https://cse.google.nl/url?sa=i&url=https://umbfoundation.org/ https://maps.google.nl/url?sa=t&url=https://umbfoundation.org/ https://images.google.nl/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.in/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.in/url?sa=t&url=https://umbfoundation.org/ https://maps.google.co.in/url?q=https://umbfoundation.org/ https://images.google.co.in/url?sa=t&url=https://umbfoundation.org/ https://images.google.co.in/url?q=https://umbfoundation.org/ https://cse.google.co.in/url?sa=i&url=https://umbfoundation.org/ https://cse.google.ru/url?sa=i&url=https://umbfoundation.org/ https://maps.google.ru/url?q=https://umbfoundation.org/ https://maps.google.ru/url?sa=t&url=https://umbfoundation.org/ https://maps.google.ru/url?sa=t&url=https://umbfoundation.org/ https://images.google.ru/url?sa=t&url=https://umbfoundation.org/ https://images.google.ru/url?q=https://umbfoundation.org/

Thank you for sharing this information! it helped my a lot with my problem klinik gigi bandung

Top Up Games Voucher Lebih Murah 20%, Cepat, dan Aman
Situs resmi top up games dan voucher harga termurah, tercepat, dan terpercaya. Beli Diamond Mobile Legends ML, Free Fire FF DM, Ragnarok X / Global Origin, HDI MD, Genshin Impact Blessing/Crystals, Call of Duty CODM, PUBG UC, Garena Shells, Steam dengan diskon dan harga promo paling murah dan banyak bonus!


https://miraclegaming.store/
https://miraclegaming.store/id/mobile-legends
https://miraclegaming.store/id/free-fire
https://miraclegaming.store/id/pubg-mobile
https://miraclegaming.store/id/genshin-impact
https://miraclegaming.store/id/valorant
https://miraclegaming.store/id/garena-undawn
https://miraclegaming.store/id/higgs-domino
https://miraclegaming.store/id/point-blank-voucher
https://miraclegaming.store/id/tri
https://miraclegaming.store/id/axis
https://miraclegaming.store/id/xl
https://miraclegaming.store/id/telkomsel
https://miraclegaming.store/id/razer-gold
https://miraclegaming.store/id/roblox
https://miraclegaming.store/id/unipin-voucher
https://miraclegaming.store/id/garena-shell-top-up
https://miraclegaming.store/id/google-play
https://miraclegaming.store/price
https://miraclegaming.store/transaksi
https://miraclegaming.store/blog
https://miraclegaming.store/account/deposit
https://miraclegaming.store/account/transaksi
https://miraclegaming.store/account/auth/register
https://miraclegaming.store/account/auth/login
https://blog.miraclegaming.store/
https://www.facebook.com/miraclegamingstore1
https://www.instagram.com/miraclegaming.store/
https://www.tiktok.com/@miraclegamingstore/
https://www.linkedin.com/in/miraclegamingstore/
https://www.linkedin.com/in/miracle-gaming-store-a4b318154/?trk=profile-badge&originalSubdomain=id
https://linktr.ee/miraclegaming.store/
https://www.facebook.com/groups/topupgamediamond/
https://chat.whatsapp.com/Dxj1WZPeIeF2XlOyAb3gKS/
https://chat.whatsapp.com/DNvFKhCMsog3AytUJ8QdD4/

Wow, what an engaging article! I appreciate the author's fresh perspective on the topic.
download tiktok hd