phpBB Forum
 
It is currently Wed Mar 25, 2020 4:13 pm




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2, 3  Next
Anyone fancy doing a bit of C++? 
Author Message
HH Donor
HH Donor
User avatar

Joined: Tue Dec 25, 2007 12:08 am
Posts: 6095
STEAM_0:0:16743808
MCID: frog
Post 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! :)


Sat Apr 07, 2012 4:01 pm
Profile E-mail
HH Donor
HH Donor
User avatar

Joined: Thu May 06, 2010 10:18 am
Posts: 118
Location: echo $HOME
STEAM_0:1:18492456
MCID: llamas_hat
Post 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?

_________________
Never attribute to malice that which can be adequately explained by stupidity.



Sat Apr 07, 2012 6:18 pm
Profile E-mail ICQ
HH Donor
HH Donor
User avatar

Joined: Tue Dec 25, 2007 12:08 am
Posts: 6095
STEAM_0:0:16743808
MCID: frog
Post 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?


Sat Apr 07, 2012 7:25 pm
Profile E-mail
HH Donor
HH Donor
User avatar

Joined: Thu May 06, 2010 10:18 am
Posts: 118
Location: echo $HOME
STEAM_0:1:18492456
MCID: llamas_hat
Post 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.


Sat Apr 07, 2012 8:22 pm
Profile E-mail ICQ
HH Donor
HH Donor
User avatar

Joined: Tue Dec 25, 2007 12:08 am
Posts: 6095
STEAM_0:0:16743808
MCID: frog
Post 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.


Sat Apr 07, 2012 8:39 pm
Profile E-mail
HH Donor
HH Donor
User avatar

Joined: Thu May 06, 2010 10:18 am
Posts: 118
Location: echo $HOME
STEAM_0:1:18492456
MCID: llamas_hat
Post 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.


Sat Apr 07, 2012 11:27 pm
Profile E-mail ICQ
HH Donor
HH Donor
User avatar

Joined: Thu May 06, 2010 10:18 am
Posts: 118
Location: echo $HOME
STEAM_0:1:18492456
MCID: llamas_hat
Post 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 66 times
File comment: source and binary
vtfcreate.zip [6.75 KiB]
Downloaded 65 times
Fri Apr 13, 2012 1:41 am
Profile E-mail ICQ
HH Donor
HH Donor
User avatar

Joined: Sat Feb 09, 2008 9:33 pm
Posts: 10091
Location: Finland
STEAM_0:1:14985898
MCID: Agentino
Post 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.

_________________
Spandex wrote:
If you're Japanese, you just win.



HH Cup Season 1 Champion
HH Cup Season 2 Champion
HH Cup Season 3 Loser


Fri Apr 13, 2012 2:14 pm
Profile E-mail
HH Donor
HH Donor
User avatar

Joined: Tue Dec 25, 2007 12:08 am
Posts: 6095
STEAM_0:0:16743808
MCID: frog
Post 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 :)


Fri Apr 13, 2012 4:26 pm
Profile E-mail
HH Donor
HH Donor
User avatar

Joined: Thu May 06, 2010 10:18 am
Posts: 118
Location: echo $HOME
STEAM_0:1:18492456
MCID: llamas_hat
Post 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!


Fri Apr 13, 2012 7:47 pm
Profile E-mail ICQ
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.