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 / Shaders not assembling?

Author
Message
Nightmare Runner
16
Years of Service
User Offline
Joined: 23rd Mar 2009
Location:
Posted: 30th Mar 2009 15:50
Hi all, for some reason when I try to load a shader using the CREATE PIXEL SHADER FROM FILE command, it returns the error "Runtime Error 7707 - Vertex Shader cannot be assembled"

The shader I'm using is one of the default ones that come with Dark Basic. I have a feeling it's something to do with the fact I'm running Vista... It's not my hardware, that's fine... Does anyone else ever get this error or am I just not coding it right? I'm only just starting to learn to use Shaders, so I'm not fully clued in with the code, as I cannot find a decent tutorial...
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Mar 2009 22:08
I guess you are trying to use the old "*.psh" and "*.vsh" files together with the DBPro BASIC3D/SHADER COMMANDS?

Forget those and use the modern HLSL "*.fx" shader file format which is supported in the following DBPro BASIC3D/APPEARANCE COMMANDS:

Quote: "LOAD EFFECT : LOAD EFFECT Filename, Effect Number, Texture Flag, DoNotGenerateExtraData
DELETE EFFECT : DELETE EFFECT Effect Number
SET OBJECT EFFECT : SET OBJECT EFFECT Object Number, Effect Number
SET LIMB EFFECT : SET LIMB EFFECT Object Number, Limb Number, Effect Number
PERFORM CHECKLIST FOR EFFECT VALUES : PERFORM CHECKLIST FOR EFFECT VALUES Effect Number
PERFORM CHECKLIST FOR EFFECT ERRORS : PERFORM CHECKLIST FOR EFFECT ERRORS
SET EFFECT CONSTANT BOOLEAN : SET EFFECT CONSTANT BOOLEAN Effect Number, Constant String, Constant Value
SET EFFECT CONSTANT INTEGER : SET EFFECT CONSTANT INTEGER Effect Number, Constant String, Constant Value
SET EFFECT CONSTANT FLOAT : SET EFFECT CONSTANT FLOAT Effect Number, Constant String, Constant Value
SET EFFECT CONSTANT VECTOR : SET EFFECT CONSTANT VECTOR Effect Number, Constant String, Vector Number
SET EFFECT CONSTANT MATRIX : SET EFFECT CONSTANT MATRIX Effect Number, Constant String, Matrix Number
SET EFFECT TECHNIQUE : SET EFFECT TECHNIQUE Effect Number, Technique Name
SET EFFECT TRANSPOSE : SET EFFECT TRANSPOSE Effect Number, Transpose Flag"


I don't have Vista so I can't check for your error specifically - but it's possible that your shaders are PS1 or VS1 files which might not be supported in Vista or by your graphics card (some newer cards have withdrawn support for the earlier shader models).

If you're really keen on getting into shaders look at this thread which has several examples and demos (and the very first post gives some useful references as well). You could also try Googling "HLSL shader tutorials", etc.
Nightmare Runner
16
Years of Service
User Offline
Joined: 23rd Mar 2009
Location:
Posted: 31st Mar 2009 10:23
Okay, I have looked into this further, and they seem to load fine if i use the "load effect" command instead...

I'm getting some great normal mapped effects in my scene now, but I have no idea how to get the lights working... Can anyone point me in the direction of a good tutorial on how to build and light a basic scene using shaders?
Nightmare Runner
16
Years of Service
User Offline
Joined: 23rd Mar 2009
Location:
Posted: 31st Mar 2009 10:36
In short, all I want to do is have a scene with models that are normal mapped in it, and the light comes out from where the camera is located (0,0,0) illuminating the scene for a distance of 1200 units, and then fade away to black. I just can't seem to find anything that will teach me how to do that...

So basically it's the shader equivalent of light brightness, color and fog... Any ideas?
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Mar 2009 13:13 Edited at: 31st Mar 2009 17:06
I see there are 4 posts on this thread but I can only read 2. I guess this means that you are new to the forum and your posts are still being "moderated" which means your replies (if any) won't be visible for a while. If that's the case, just be patient and wait a while - your posts should eventually appear (I think that's how it works - it's been so long since I was in the same position myself ).

Edit Just noticed that my first reply forgot to give the link.

Here it is:

Learning to Write Shaders

Hope that helps.

Edit2 Your new posts show now. If you look at the above thread you should find several examples with lighting.
Nightmare Runner
16
Years of Service
User Offline
Joined: 23rd Mar 2009
Location:
Posted: 1st Apr 2009 03:23
Thanks Green_Gandalf Yeah, it sucks about having to wait for the moderation but I'm glad they do it. Keeps out the riff raff!

I've had a browse around that forum and it really still isn't making sense to me... I've found alot of fantastic examples that do almost exactly what I want, but there's no lessons on how to actually do it myself. Purely for the sake of my own learning, I don't just want to copy and paste someone else's code. I'm a bit of a die-hard that way

I just want my normal bump maps to work, have a fall-off on a light that stays with the camera (to simulate the fog effect) and have some real-time shadows. Every time I get one of these three things working, the other two stop working

It's a very big post, the one you mentioned, so I'll keep reading through it, but in the meantime, are you able to offer any more advice?

Thanks you heaps for your help!

Login to post a reply

Server time is: 2025-05-23 04:16:12
Your offset time is: 2025-05-23 04:16:12