PDA

View Full Version : Unformatted Text for Vertex Shaders


Bossa Nova
2003.04.07, 10:13 PM
I've been looking working lately with vertex shaders. I really need to find a good way to export them. Generally I write them in ShaderBuilder. However the .shdr that it exports has a bunch of extra text that I don't want. Basically, I wan't to be able to read the file with a filestream without any extra work. In other words, I don't want anything in it but the shader itself.

I tried exporting the shaders to SimpleText. However, they generally have a string of numbers at the end (/value style). I dunno what these are exactly.

If anyboyd knows of a good way to store only the text, pls let me know. Thanks.

OneSadCookie
2003.04.07, 10:23 PM
Copy & paste the text into TextEdit, make sure you're set to plain text mode.

Bossa Nova
2003.04.07, 11:58 PM
Actually, your right Cookie.

However, thats not the problem at all. I loaded a .txt as a resource into my project file. When I output the string that I read from the file there is a block of numbers at the end at the end in the form /x where x is some number.

These do not show up in the text of the resource at all (when I open it in Project Builder). When I delete the final line of the shader the numbers go away. However, when I add that final line back -or change anything else in the shader they (or other random letters/nubmers) return. What could cause this?

An example of the problem:
http://homepage.mac.com/jkross/.cv/jkross/Public/error.jpg-binhex.hqx

OneSadCookie
2003.04.08, 12:28 AM
my bet is that you have a .rtf and not a .txt.

Bossa Nova
2003.04.08, 08:17 PM
Found the problem.

In my vertex shader class I had a char* pointer to hold the data for the shader. The pointer seemed to be taking some extra data onto my string. --Makes sense I guess.

anyway, Thanks for the help.