h3d custom shader

106 views
Skip to first unread message

度曲

unread,
Aug 6, 2014, 7:11:57 PM8/6/14
to haxe...@googlegroups.com
Can I be pointed to an example of authoring a shader applied to a Mesh or CustomObject in h3d?

I'm guessing CustomObject is the one used for shaders I want to use?

Thanks

David Elahee

unread,
Aug 7, 2014, 6:05:41 AM8/7/14
to haxe...@googlegroups.com


If you want to "modify" meshMaterial , you can overload the whole class like what i did with drawable here :
https://github.com/motion-twin/h3d/tree/master/samples/real_world_bloom

I advise you use the meshMaterial prefab...

If you don't go the meshMaterial way :
https://github.com/motion-twin/h3d/tree/master/samples/ortho
I used it for 2d object but doing it for mesh is similar.

To go extent, basically you crush MeshMaterial.hx with you own version which allows to benefit from all the smart things that were done with it and can add you own computations.

Yeah it's brute and not documented but we do not intend to promote the current hxsl version which is pretty raw compared to the future hxsl3 which sadly is not yet ready.

Good luck !







--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--
David Elahee


度曲

unread,
Aug 18, 2014, 1:38:51 PM8/18/14
to haxe...@googlegroups.com
Yes I want to use my shaders. I tried real_world_bloom and don't see a place where I can use custom shaders.

The ortho example has a plane2d from the looks of it that uses custom shader. When running I see the background alternating between red and magenta, but no plane2d object, even if I change its shader to output [0,1,0,1] instead of from texture.

What might I be doing wrong?

Thanks

David Elahee

unread,
Aug 18, 2014, 5:14:37 PM8/18/14
to haxe...@googlegroups.com

I ll check the samples to see if everything is ok, as we develop on a daily basis, there are breaking changes.

See ya.

Reply all
Reply to author
Forward
0 new messages