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.

Newcomers DBPro Corner / Material effects on a textured object.

Author
Message
ConnectionUp
7
Years of Service
User Offline
Joined: 3rd Jun 2013
Location:
Posted: 4th Jun 2013 00:13
After learning how to load a 3D object into space, I'm still trying to figure out how to add a couple of basic effects to a texture like make parts of it glow on a 3D object, even when light is not shining on it.

I'm still trying to find a way on how this could be done.

Also, can I load a 3D object and apply it with a material(with multiple textures and color parameters in it) instead of just the texture?

Is a Quake3 style texture shader possible in DBPro?
Brendy boy
15
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 6th Jun 2013 22:30 Edited at: 6th Jun 2013 22:30
Quote: "I'm still trying to find a way on how this could be done."

with pixel shaders

Quote: "Also, can I load a 3D object and apply it with a material(with multiple textures and color parameters in it) instead of just the texture?"

no, dbpro supports only textures (one texture per limb). You can apply several textures per limb in external program and export the model in .x format and then load it in dbpro

Quote: "
Is a Quake3 style texture shader possible in DBPro?
"

what's that?

James H
13
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 13th Jun 2013 04:42
Quote: " Also, can I load a 3D object and apply it with a material(with multiple textures and color parameters in it) instead of just the texture?"


As far as materials go yes you can have them in dbp, every objects mesh/limbed meshes each have a material even without the texture, as standard. The limit is 1 material per mesh, look here to get a better understanding for materials;
http://msdn.microsoft.com/en-us/library/windows/desktop/bb147175%28v=vs.85%29.aspx
Take a look at object appearance commands in help files to make the required property settings you want. Take a look at vertex data commands to operate on any individual vertex.
If your using shader effects you can choose to set some or all of the material properties(not sure about emmisive) either in the shader or by passing the settings to the shader from dbp code, but it all depends on what type of shader it is and what it does. Shaders can be either vertex shaders(.vsh files), pixel shaders(.psh files) or both(.fx files) in dbp, Ive never used asm shaders but Ive seen an example on the forums here somewhere, but you will have to choose whats best for your needs. In your case get familiar with all object commands and properties before you delve into shaders is my advice.

What you describe sounds more like a blend shader that takes several textures and uses 1 of them to "paint" the other textures to the mesh based on pixel position, pixel rgba values and uv coordinates of the "painting" texture for each polygon of the mesh, you can find examples of this in various forms using the search feature situated at the bottom of each page of this forum, some use them to paint paths and different areas of a terrain for example, the limit for textures in dx9 on a mesh is 8 afaik.

Quote: "After learning how to load a 3D object into space, I'm still trying to figure out how to add a couple of basic effects to a texture like make parts of it glow on a 3D object, even when light is not shining on it.

I'm still trying to find a way on how this could be done."


Reason I address this second and not first is because it may be possible to achieve a cheap similar result by faking it with multiple meshes and/or using in part the material properties previously detailed in the link and help commands along with the blend mapping command(not blend shading as the cheap way would not be to use shaders) and perhaps other mapping commands if using multiple meshes - this is all more of guess on my part as Ive seen normal mapping of a fashion done with this command. You will have to play around a fair bit though. IF I get chance to I`ll see if I can find a cheap solution, right now though I don`t have the means to for various reasons.

Quote: " Is a Quake3 style texture shader possible in DBPro? "

Based on the screen shots brought up by google images I would have thought so. DBP in its official form is dx9 (and I think some of dx8) so the shader models can`t go beyond sm3. There is an in-house version of dbpx10 but tbh its difficult enough for advanced users let alone beginners but that can take you to sm4. So find out which shaders your interested in from Quake3 and determine what shader models they use. If they require a dx10 graphics card then the official version of dbp won`t cut it.
James H
13
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 15th Jun 2013 04:57 Edited at: 15th Jun 2013 04:58
Attached is cheap fake way of doing partial texture glow by using 2 identical objects sharing same position and rotation, the first has light and is textured normally(note the part I want to glow is partially visible through the second object so must not show brick which is why that huge dot is there which is made from second fire image), the second doesn`t get affected by light and uses blend mapping and ghosting, you will have to create your own textures to best suit your needs, the ones I`ve used took me all of 2 mins to do so they are not brilliant

Attachments

Login to view attachments
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jul 2013 22:36
James H, I tested your code, and I found it looks much better if you don't ghost it, but instead modify the alpha channel of the texture. I've created a version that doesn't require a download. This should work straight out of the box:



TheComet

Melancholic
10
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 1st Jul 2013 22:48
@James H, this is pretty much the same as TheComets code but optimized slightly so it's easier to understand




I can count to banana...
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jul 2013 22:49
Melancholic, your code doesn't seem to work for me. I made this change to it:



TheComet

Melancholic
10
Years of Service
User Offline
Joined: 26th Nov 2009
Location:
Posted: 1st Jul 2013 22:50
@TheComet, Ah silly me! Forgetting to close brackets...


I can count to banana...
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Jul 2013 22:52
@Melancholic - That's an interesting addition you made to your code. You gave me the idea of using some subsurface precalculations:



TheComet

James H
13
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 2nd Jul 2013 00:15 Edited at: 2nd Jul 2013 00:19
Cool, I can`t see either of your snippets though, any idea why when I try to view them on any post that I just keep getting logged out?

Edit hmm they are images of the code snippet box rather than actual code snippets - I can see snippets on other threads just fine..
chafari
Valued Member
14
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Jul 2013 01:57
Quote: "Edit hmm they are images of the code snippet box rather than actual code snippets - I can see snippets on other threads just fine.."



It seems that this is the last way to have fun today ... once is fine, but it is somewhat annoying.

I'm not a grumpy grandpa
James H
13
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 2nd Jul 2013 04:30
TY chafari, I see
IMO once is too many, its not constructive and very rude - every page I open costs me money on my mobile dongle so I wish folk would GROW UP - what exactly is the point of TheComet and Melancholic posting this rubbish? If you guys want fun how about you do it somewhere else? If you guys have a problem with something I`ve typed then say so instead of posting rubbish. Use your accounts here responsably. The 2 posters prior to my post have keyboards and can respond appropriately... I`m sure they are more than capable on their own to respond and don`t have a need for you 2 to act on their behalf. As it stands I think I`ll utilise that little red icon on the bottom right of each post, as far as I`m concerned logging anyone out should be considered an intrusion on their account by tricking folk to alter their login status and maybe I have this wrong but I do consider this to be trolling. The only reason I can see you guys would spend time so inappropriatly in this thread is my reference to what a material is and the non pixel shader option to a newcomers request after Brendy already made a response. I have a great respect for Brendy`s work as it happens. I feel my contribution regarding materials was correct(or do you guys feel microsoft aren`t as smart as you?) - although I did fail to mention that the texture and effect on a limb/mesh also can be considered components of a material but then Brendy already covered part of that. Everything else in my post was accurate as far as I can tell if somewhat lacking in a fuller explanation to materials as I was pushed for time which I did in fact hint upon and Im surprised you don`t respect the fact I took the time and effort to do so. As for how good a solution I provided in the download is - well its more than what either of you have input even if it isn`t by any means the best, furthermore I spent very little time on it intending only to provide a possible solution so that the OP can get an idea of what I meant, the point being pixel shaders are not the only option, especially for someone who appears to just be starting out.

Login to post a reply

Server time is: 2020-08-12 08:31:24
Your offset time is: 2020-08-12 08:31:24