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.

Geek Culture / does this shader code look ok?

Author
Message
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 8th Nov 2011 21:52


does anyone see anything wrong with this shader code? because when I ran it it complained of a syntax error but it looks fine to me.

(I'm progmmatically creating the shader).

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Isocadia
15
Years of Service
User Offline
Joined: 24th Jul 2009
Location:
Posted: 8th Nov 2011 22:13
I'm a complete noob at this, but my first impression is that there needs to be a comma after the second last line. I'm a complete noob, but every line between the main brackets have a comma besides the last one
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 8th Nov 2011 22:15
naw, if that was it the compiler would of flagged it. that's the way you initialize arrays in C++ (one of the ways)

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 8th Nov 2011 23:32
Just as a reference here is the error from the shader:



so yea not sure what the heck is wrong with my shader code in the above code snippet

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 8th Nov 2011 23:41
Try getting rid of the indentation inside the strings

"everyone forgets a semi-colon sometimes." - Phaelax
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 9th Nov 2011 00:16


nope still not working (assuming u meant this way rather then my earlier code)

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 9th Nov 2011 00:22 Edited at: 9th Nov 2011 00:29
Make sure it's saved in the proper format. I was having a similar problem with Uscript a while back and it turned out i was saving the .txt files in the wrong format. According to a half arsed google it should be UTF-8 encoding (don't take my word for it).

Also, whats "technique One" and "pass one" and is the capitalization correct on them?

Also, i don't know anything about this...
heyufool1
16
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 9th Nov 2011 01:00
I know I always had troubles with line breaks in my C++ strings, so make sure there aren't any in there.

"So hold your head up high and know. It's not the end of the road"
Switch Game Engine
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 9th Nov 2011 01:03
Quote: "Make sure it's saved in the proper format. I was having a similar problem with Uscript a while back and it turned out i was saving the .txt files in the wrong format. According to a half arsed google it should be UTF-8 encoding (don't take my word for it).

Also, whats "technique One" and "pass one" and is the capitalization correct on them?

Also, i don't know anything about this... "


as i said it's generated on the fly runtime, (on the GPU) so no file used.

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Nov 2011 13:26
Quote: "does anyone see anything wrong with this shader code?"


Yes. You've missed a semi-colon here:

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 9th Nov 2011 18:38
Is it really that easy to add shader code directly in a c++ file? If so then I may start looking into that myself...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 9th Nov 2011 22:10
it is: here is what i got from gamedev.net (i also started a thread about it on there).



turns out i was doing it wrong (no surprise there);

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Nov 2011 22:59
Yes. That has the missing semi-colon.

Login to post a reply

Server time is: 2025-05-20 07:56:21
Your offset time is: 2025-05-20 07:56:21