Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How Would I Combine 2 Shader Effects On A Single Object

Author
Message
Red Ocktober
21
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 23rd Sep 2004 07:41 Edited at: 23rd Sep 2004 07:46
i guess the title says it all... (this is sort of a follow up question to the one i asked earlier)

say, for instance i've got a single object with two different textures, and i want to have 2 different shader effects on it...

can i use multiple shaders on this one object?

or

do i have to make a combination of the two shaders in a single .fx file?

or

would i have to make em separate objects and link em together?

THANKS for any and all info and/or ideas

--Mike
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 24th Sep 2004 02:05 Edited at: 24th Sep 2004 02:06
As far as I understand shader, you can only combine a single vertex shader, and a single pixel shader effect on an object. Shader is used to overrides the two processes in the normal rendering pipeline of an object. You can include both vertex and pixel shader in an FX file.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Red Ocktober
21
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 24th Sep 2004 02:15 Edited at: 24th Sep 2004 02:19
... thanks B

i appreciate the info... i'm still learning this shader stuff, and it seems as if everyone has a different implementation of some aspect of it.

[added]

hey, another follow up to the follow up question...

how would you go about constructing a small level with mulitple shader effects at different parts... a combination of different objects?


THANKS again...



--Mike
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Sep 2004 02:17
It's possible to apply a shader to a specific object limb, so each object limb can have it's own shader - but I don't think DBPro would let you use 2 shaders on the same mesh/limb.


Van-B


Muhahahahaha.
Red Ocktober
21
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 24th Sep 2004 02:33 Edited at: 24th Sep 2004 02:37
thanks Van...

what i'm looking at doing is constructing a submarine interior, and i want to get a rusted bumpmapped appearance on the hull walls, and a slightly different appearance of the instrument panels...

... and a shiny metallic shade on the scope masts.

i've pretty much completed the project in 3DRAD, but am considering using a shader capable tool for the follow up version...





right now i have a sub interior modelled, but it is a single hierarchical model, and i am wondering how i would approach the shader aspects of this...



oh yeah... i'm gonna need some enviro mapping or shader effects for the ocean too

--Mike
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Sep 2004 02:38 Edited at: 24th Sep 2004 02:41
That setup should be ideal - you'd have to use different textures and limbs anyway - so applying a metal rust shader to the hull and bump mapping to the panels etc should be perfectly fine. Might sound strange but your biggest headache will probably be getting good shaders.

Don't know if you've found it already, but there's a massive post with a lot of nice shaders posted in it, there are a couple of dedicated users who are doing some great work in that department.

Looks great BTW, I loved Silent Service on the 16-bits - I can't even think of any recent sub sims - definate gap in the market.


Van-B


Muhahahahaha.
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 24th Sep 2004 02:45
Ok, there are several ways you can do this.

One is like what Van B mentioned above. You apply the texture with its shader effect on individual limb.

If you have a single mesh, you could apply different effect on different portion on the mesh by using texture mapping. For instance, I create a shader that does bump and specular effect. The shader needs two texture map, a bump map, and a specular map. Thus, by playing around with the texture map, I can specify the degree of bump and spec at different portion of the mesh. I found that this is more intuitive as you were able to define the shader effect area during modelling and texturing stage.

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Red Ocktober
21
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 24th Sep 2004 02:46 Edited at: 24th Sep 2004 03:22
yes V... i've found the massive shaders thread, and am indebted to the generous coders who have posted their code up for sharing...

i'm at the point now where i can mod the code a bit to get variations on a particular shader, but have yet to whip up one totally from scratch...

RenderMonkey's export format for .fx doesn't seem to be what DB is looking for... and i still have to glean out the particulars to get em working.

question... is there any plans for a similar app (on a smaller scale) for DB in the near future... or maybe a translation util for .fx?


thanks again Bull... sounds like a plan worth looking at.

--Mike
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 24th Sep 2004 03:06 Edited at: 24th Sep 2004 03:08
Use NVidia's FX Composer instead - I know that is the one that Lee uses so presumably it will work better with DBPro.

An effect (.FX) file can contain multiple techniques though, so it is possible to apply multiple effects to an object.


BlueGUI:Windows UI Plugin - All the power of the windows interface in your DBPro games.

Login to post a reply

Server time is: 2025-06-24 04:25:24
Your offset time is: 2025-06-24 04:25:24