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 / Really need help with modding this shader!

Author
Message
Inflictive
17
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 25th Nov 2011 21:16
Ok, so, 5 days ago I posted this into the "Learning to write shaders" forum, nobody really helped me. I figured if I posted it here someone might actualy see it and help me finally figure this out!

This shader, from dark shader, is a normal mapping+specular mapping shader. However, the problem is, it uses bones to calculate the specular/normal mapping stuff correctly in animated models. I'm not using bones or animation anywhere in my game because it is a space shooter and I don't need to. I did try adding bones in blender... just no... blender doesen't export directx right, and I don't want to put in bones I don't need. For the past 5 days I hae been trying to modify the shader myself, and looking on the internet for a shader that does normal+specular mapping without bones. No luck.

So I was hoping someone who knows HLSL could modify this shader for me so it doesen't use or requrie bones. Code is posted below.



If this helps, I think the root of the problem is near the top where it says:

"float4x4 boneMatrix[32] : BoneMatrixPalette;"

The dark shader help file says:

"BoneMatrixPalette - an array of matrices for calculating the position of vertices from bones in the model"

So, I don't know but I think if you change that everything else will fall into place. But maybe not.

Thank you!



Your signature has been erased by a mod - Please reduce it to (600x120) maximum size
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Nov 2011 21:34
Any particular reason to modify that shader rather than use another that does what you want?
Inflictive
17
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 25th Nov 2011 21:44
I can't find another one that works.

Your signature has been erased by a mod - Please reduce it to (600x120) maximum size
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Nov 2011 00:05 Edited at: 26th Nov 2011 00:08
Is that a full screen shader or an object shader... I am pretty sure from my run in with DarkShader that there are two types of shaders...

Just what little I know on Shaders...

Hoping it helped somewhat...

EDIT

come to think of it... maybe if you explained how you are hoping to use it... show a screen shot using any bone based model... and perhaps a solution can be brought forward...

I just wish I could learn shaders soon...

Inflictive
17
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 26th Nov 2011 01:14
I want to use it to make a planet earth for my main menu, and to make the player's ship look cool. And maybe other things. Yes, it is an object shader lol. Here is a screenshot of this model called aiko, which is like a human model, that came with DS with the effect.(Attached)

Your signature has been erased by a mod - Please reduce it to (600x120) maximum size
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Nov 2011 02:11
It says you require a boned model... but haha

sorry

anyhoo

moving on... I hope someone can come to the rescue... can you not achieve the same effect maybe by using a UV map or something and add light... as I said this effect area is still area 51 to me...

Try thinking out of the box as I just did... its what makes programming so joyful...

Inflictive
17
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 26th Nov 2011 09:31
Yes, a boned model, that is what she said.

Anyway, for the time being I found this planet shader, so I'm not hung up anymore, but I can still see use for a bump+specular shader in the future.

http://xna-uk.net/blogs/randomchaos/archive/2009/04/22/basic-hlsl-lighting-techniques-episode-8-planet-shader.aspx

It's funny, this shader didn't even work, but I managed to fix it.

I now present to you, the 54 main smileys.


Your signature has been erased by a mod - Please reduce it to (600x120) maximum size
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Nov 2011 10:27
Err yay

but yeah try experimenting with different effects... maybe you could find something...

Also could you explain how you used that XNA thing inside DBPro might help ...me er I mean others here on the forum

Cheers.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Nov 2011 16:10
Here's a Dark Shader project with a bumpmapping + specular mapped shader. Just unzip somewhere and open with Dark Shader.
Inflictive
17
Years of Service
User Offline
Joined: 16th Jun 2009
Location: Altis
Posted: 27th Nov 2011 21:37
Sweet thanks. I know I will use it later on.

MrValentine-XNA runs on directx, just like dark basic. And they use the same shader code. But the one linked to didn't work, but I fixed it. The fixed shader files are attached if people want to use them. (use the .dbs one in your projects n'things, and keep the .fxh one in the same folder)

david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 27th Nov 2011 21:37
I supplied a sample shader in the learning to write shaders section because I already suggested that it would be better to write or use a new one. I said I thought you and the other person could both make use of it as, it was what I thought both of you were looking for.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Nov 2011 13:01
david... «left field....... What?

Login to post a reply

Server time is: 2026-07-10 01:59:05
Your offset time is: 2026-07-10 01:59:05