Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Tree Leaves Shader #326524
06/01/10 14:54
06/01/10 14:54
Joined: Dec 2009
Posts: 217
Italy
PietroNifosi Offline OP
Member
PietroNifosi  Offline OP
Member

Joined: Dec 2009
Posts: 217
Italy
Ok so,
I'm in need of a shader that applies orientation to the leaves so that they keep on facing the camera. Just like sprites.

I wanna have a tree composed by 2 separate meshes, trunk and leaves, but it would be a pain to singularly place sprites while generating them with a 3dsmax plugin is much easier.

Can it be done? I'm not a programmer.

Last edited by PietroNifosi; 06/02/10 03:17.

Dear Fans, to celebrate our 500.000 downloads,
Evhacon 2 is now FREE TO PLAY on Amazon Underground!
HD Version: https://www.amazon.com/gp/product/B071FKSVG2
LD Version (Optimized for lower devices): https://www.amazon.com/gp/product/B0719TXFJN
Re: Tree Leaves Shader [Re: PietroNifosi] #326543
06/01/10 15:57
06/01/10 15:57
Joined: Mar 2009
Posts: 29
DavideG Offline
Newbie
DavideG  Offline
Newbie

Joined: Mar 2009
Posts: 29
Ciao Pietro... Se mi scrivi in italiano cosa cerchi ti posso aiutare... wink


-----------------------------------------
Intel Core i7 950 4.2 GHz OC
ASUS P6T DELUXE V2
Corsair H50 Liquid Cooling System
6 GB RAM DDR3 Triple Channel 1600 Mhz Corsair XMS3
Gainward GeForce GTX 480 1.5 GB GDDR5
HD Barracuda 1 TB 7200 RPM 64 MB Cache

Re: Tree Leaves Shader [Re: DavideG] #326577
06/01/10 17:44
06/01/10 17:44
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
@DavideG: I dont speak italian, you give already a solution? Please write in english...

Re: Tree Leaves Shader [Re: Widi] #326585
06/01/10 18:58
06/01/10 18:58
Joined: Dec 2009
Posts: 217
Italy
PietroNifosi Offline OP
Member
PietroNifosi  Offline OP
Member

Joined: Dec 2009
Posts: 217
Italy
no he didn't, can you please help?


Dear Fans, to celebrate our 500.000 downloads,
Evhacon 2 is now FREE TO PLAY on Amazon Underground!
HD Version: https://www.amazon.com/gp/product/B071FKSVG2
LD Version (Optimized for lower devices): https://www.amazon.com/gp/product/B0719TXFJN
Re: Tree Leaves Shader [Re: PietroNifosi] #326621
06/01/10 20:26
06/01/10 20:26
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
if you upload the model in MDL format I´ll take a look at it

Re: Tree Leaves Shader [Re: Hummel] #326623
06/01/10 20:29
06/01/10 20:29
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
As a programmer (and a poor modeller), I think the sprite way is the best...

All you gotta do is attach the sprites to specific vertices of your model,
and then they'll always be positioned correct, and always face the camera...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Tree Leaves Shader [Re: EvilSOB] #326630
06/01/10 21:17
06/01/10 21:17
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
That is a very bad proposal EvilSOB, as the sprite aproach will be many many times slower while it will be fast with a shader.

Re: Tree Leaves Shader [Re: Slin] #326641
06/02/10 00:28
06/02/10 00:28
Joined: Dec 2009
Posts: 217
Italy
PietroNifosi Offline OP
Member
PietroNifosi  Offline OP
Member

Joined: Dec 2009
Posts: 217
Italy
I can't explain it easier

Ok you have a mesh composed of 20 triangles (10 quads). Have them face the camera all the time.

Can you do that in a shader? can you script that for me please? I don't think it's that difficult from a theorical point of view but like i said i'm not a programmer.

Last edited by PietroNifosi; 06/02/10 03:16.

Dear Fans, to celebrate our 500.000 downloads,
Evhacon 2 is now FREE TO PLAY on Amazon Underground!
HD Version: https://www.amazon.com/gp/product/B071FKSVG2
LD Version (Optimized for lower devices): https://www.amazon.com/gp/product/B0719TXFJN
Re: Tree Leaves Shader [Re: PietroNifosi] #326644
06/02/10 01:51
06/02/10 01:51
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
In a vertex shader, each vertex is generally only aware of its own position and its normal. There's a bit more than that, but basically you want each quad to rotate around the quad's centre, and in order to do that each vertex needs to know its position relative to its quad's centre, and this cannot be done in a shader.

I would personally do it with bones, if you're using the A8 beta, and do bones animation in the vertex shader. Use ent_bonerotate to orientate the bones when you need to. It'd be worth a try, anyway. It might still be slow with lots of bones, and it'd be tedious to set up. It could be done in A7, but all the vertices will be moved using the CPU, and that'll be slower.

Alternatively, if your Max plugin can put down single vertices instead of quads it wouldn't be much effort to write a function that just places a sprite at each of those vertices -- like Slin said, this'll be relatively slow, but A8 has sprite instancing, which might make up for it.

In short, I don't think what you want to do is feasible in A7, but A8 might have what you need on the off chance that you're a private beta tester.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: Tree Leaves Shader [Re: JibbSmart] #326647
06/02/10 03:17
06/02/10 03:17
Joined: Dec 2009
Posts: 217
Italy
PietroNifosi Offline OP
Member
PietroNifosi  Offline OP
Member

Joined: Dec 2009
Posts: 217
Italy
I see.. this explains a lot. Now I see why loopix trees are done that way, static.

Last edited by PietroNifosi; 06/02/10 03:17.

Dear Fans, to celebrate our 500.000 downloads,
Evhacon 2 is now FREE TO PLAY on Amazon Underground!
HD Version: https://www.amazon.com/gp/product/B071FKSVG2
LD Version (Optimized for lower devices): https://www.amazon.com/gp/product/B0719TXFJN
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1