H|H ~ The Hampshire Heavies Community : Forum
http://www.thehh.eu/forum/

Anyone fancy doing a bit of C++?
http://www.thehh.eu/forum/viewtopic.php?f=30&t=8451
Page 2 of 3

Author:  frog [ Sat Apr 07, 2012 4:01 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

(WAV) Fantastic!

It's exactly what was required and having the option of using different DXT codecs is a bonus.

It's now in use and successfully generating the vtf's for the spawn notice board.

Thank you! Thank you! :)

Author:  A Llamas Hat [ Sat Apr 07, 2012 6:18 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

No big deal. Glad if it works :)

But I just had a look at it on HH3 and this is what was displayed for me:
Attachment:
File comment: Screenshot


Does it do that for anyone else?

Author:  frog [ Sat Apr 07, 2012 7:25 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

Strange, because the VTF views fine in VTFedit, as you said earlier

The files are getting generated here

http://www.thehh.co.uk/orangebox/tf2/ma ... m/hhrules/

Maybe it's something to do with the header, or the format. VTFedit says that it's DXT1 One Bit Alpha, but there is no alpha. I don't know if that's anything to do with it. Guess can only find out by trying.

Perhaps I should set up a test environment on the server where new decals can be generated at will and linked into HH3?

Author:  A Llamas Hat [ Sat Apr 07, 2012 8:22 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

I can see a few things that may go wrong.

  • First the format: You are right, it's not plain DXT1. I've checked and DevIL only uses DXT1_ONEBITALPHA for VTFs, it's hardwired in the code. Can you swith it to DXT3? Let's see if the problem remains then.
  • Second come the flags: VTF supports various image flags, none of which can be set through DevIL. I've checked and the old VTFs had three flags set: "Anisotropic", "No Mipmap" and "No Level of Detail". May be that there's a problem here.
  • Third the VTF version used: DevIL writes headers for version 7.2. The current version is 7.5, the old VTFs had 7.4.

Could you try switching to DXT3? With that we may rule out DXT1_ONEBITALPHA being the problem. If this doesn't help I'll have to look into writing the header myself.

Author:  frog [ Sat Apr 07, 2012 8:39 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

Set to DXT3 and regenerated.

I don't think the version number matters. The example in the sourcemod plugin that uses it is 7.1. (also DXT5 with an alpha channel)

http://forums.alliedmods.net/showthread.php?t=69502

Have to be brief atm, busy busy.

Author:  A Llamas Hat [ Sat Apr 07, 2012 11:27 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

Still the same, sadly. I'll try to have a look at writing a complete VTF file in C. But this may take a few days.

Author:  A Llamas Hat [ Fri Apr 13, 2012 1:41 am ]
Post subject:  Re: Anyone fancy doing a bit of C++?

I'm cautiously optimistic about giving this another try.

I wrote the header information myself this time; boy was that a pain to figure out. But the header now matches with that of a VTF created with VTFEdit almost exactly. Four bytes (in the header padding of all places) differ in value.

Anyways the results open fine in every VTF-enabled application I could get my hands on; that's as was. For additional testing I imported one converted VTF in TF2 and used it as spray. It showed fine when used on the server. If that doesn't show they are valid I don't bloody know what will.

Program usage and setup remains the same as before. I'll attach one zip file containing the source and a precompiled binary (vtfcreate.zip). Additionaly I'll upload another zip with the example image that I tested as a spray (example.zip).

Hope it works this time. I'm starting to run out of ideas [mixed]

Attachments:
File comment: example converted image (+ original image)
examples.zip [33.04 KiB]
Downloaded 65 times
File comment: source and binary
vtfcreate.zip [6.75 KiB]
Downloaded 64 times

Author:  Agent 47 [ Fri Apr 13, 2012 2:14 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

Really appreciate the work you guys put into these kinds of things. :) I know I would never have the patience to produce and/or tweak code like that.

Author:  frog [ Fri Apr 13, 2012 4:26 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

A Llamas Hat, you are star for keeping on with this. I've updated to the latest version that you have provided.
I'm not able check that it's working as yet, but many many thanks anyway :)

Author:  A Llamas Hat [ Fri Apr 13, 2012 7:47 pm ]
Post subject:  Re: Anyone fancy doing a bit of C++?

You're welcome :)

I just checked on HH2 as well as HH3 aaaand <imagine a drumroll here please>
... it works (WAV)

Seeing this work as intended provides a certain gratification :D

Rendering was pretty much as I remember it from the old boards. Maybe I'll do some tweaking over the weekend. But overall it's displaying nicely already. The rest is just fine tuning of reflectivity values and the like.

Here are two screenshots I made on HH2 just now:
Spoiler Alert:

If you see anything wrong with it let me know!

Page 2 of 3 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/