Results 1 to 2 of 2

Thread: Reading a file to make a texture

  1. #1

    Reading a file to make a texture

    I used Photoshop to convert a jpeg photo into a targa bump map file. I want to read up this file from the directory containing the JavaScript code and do a little bit of processing to create a bump map texture (remove the 18-byte header, flip BGR -> RGB). But all of the examples I've found for loading texture information from files use gifs, which apparently are acceptable with no further processing. Can someone give me a hint on how to get a binary file (such as a targa file) into JavaScript arrays, which I can then pass to a texture?

    Alternatively, maybe there's an output from Photoshop and some JavaScript syntax to get to a bump map texture without JavaScript manipulation of the data?

  2. #2

    Re: Reading a file to make a texture

    Ah. I finally discovered that png and jpg files are also accepted, not just gif. Dunno where there is any documentation on the acceptable file formats (by experiment, targa files are not accepted).

Similar Threads

  1. Replies: 0
    Last Post: 11-13-2012, 12:21 AM
  2. Reading file in OpenCL program
    By naroqueen in forum OpenCL
    Replies: 4
    Last Post: 12-19-2010, 06:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •