Unformatted Text for Vertex Shaders

Bossa Nova
Unregistered
 
Post: #1
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Copy & paste the text into TextEdit, make sure you're set to plain text mode.
Quote this message in a reply
Bossa Nova
Unregistered
 
Post: #3
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/jkros...binhex.hqx
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
my bet is that you have a .rtf and not a .txt.
Quote this message in a reply
Bossa Nova
Unregistered
 
Post: #5
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLSL geometry- and multipass-shaders (nogo?) mcMike 3 5,584 May 2, 2008 05:51 AM
Last Post: mcMike
  Enabling OGL fog in shaders kordova 7 4,959 Jul 12, 2006 10:12 AM
Last Post: kordova
  Program for previewing / editing textures & shaders? haxolotl 4 4,399 Jun 7, 2006 12:48 PM
Last Post: ravuya
  cubemaps with shaders akb825 3 3,037 Apr 5, 2006 06:24 PM
Last Post: akb825
  Shaders for OpenGL 1.5? Nick 14 6,345 Mar 25, 2006 11:23 AM
Last Post: DanLab