Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1] 2 3 ... 5
  Print  
Author Topic: Zak's HLSL Sky Demo in VB.NET (Download)  (Read 12831 times)
tweakbox
Customers
Community Member
*****
Posts: 1194


« on: April 26, 2006, 07:07:46 PM »

I got bored this morning at work and decided to start from scratch to get Zak's HLSL sky shader demo running in VB.NET.  I've gotten 4 or so PM's about people asking if I had this done yet, and I hadn't really even been working on it.  But anyway, here it is.  I realized that before I was going about it all the wrong way, trying to convert Zak's entire project over from C# to VB.NET, and that was a dumb idea.

So, what I basically did here was wrap the sky math class into a dll, just leaving it C# exactly how Zak had it, except for switching all of the xyY stuff to xyE stuff since VB has a fit about y and Y being the samething (don't ask why I chose E, I really don't know Wink)

Then I just took the sky class and did essentially a line by line conversion from C# to VB.NET.  I also tossed in a few of the other things that were needed for it to work that were in other classes.

It's just a plain example.  The idea was to just get the workings of the sky stuff in a running VB.NET project.  It's up to you to dig through it now and make it work for you Wink

So, without further delay, here's the download.  You will need the latest managed dll as well as the directx 29 library.  Everything else should be there for you.  The media is in the debug directory.  If you have any problems with it, go bug Zak  :twisted:

http://www.ashenbrook.com/VB.NET HLSL Sky Shader.rar

EDIT: There seems to be something wrong with the forum's URL tag.  It doesn't work  :?
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
Vuli
Customers
Community Member
*****
Posts: 407


« Reply #1 on: April 26, 2006, 08:24:36 PM »

Quote from: "tweakbox"

EDIT: There seems to be something wrong with the forum's URL tag.  It doesn't work  :?


Its your white spaces Wink

...does not work:
http://www.ashenbrook.com/VB.NET HLSL Sky Shader.rar

...does work
http://www.ashenbrook.com/VB.NET%20HLSL%20Sky%20Shader.rar

V
Logged
tweakbox
Customers
Community Member
*****
Posts: 1194


« Reply #2 on: April 26, 2006, 08:39:36 PM »

Oh, oh well  :lol: At least it still works either way, just with a little extra effort the first way.
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #3 on: April 26, 2006, 09:32:42 PM »

Nice work!! Thanks for making that, and sharing it...!
It's funny really, because someone emailed me saying that's he'll make ports of most of my C# demos to VB.Net, and send them to me in a week or so...
I'll keep you informed, but in the meantime this is a great conversion Smiley
Logged

tweakbox
Customers
Community Member
*****
Posts: 1194


« Reply #4 on: April 27, 2006, 07:02:55 AM »

Quote from: "Zaknafein"
Nice work!! Thanks for making that, and sharing it...!
It's funny really, because someone emailed me saying that's he'll make ports of most of my C# demos to VB.Net, and send them to me in a week or so...
I'll keep you informed, but in the meantime this is a great conversion Smiley


No problem Wink  And at least now that I have a pretty decent understanding of what the heck all is going on, I can mess with it some more and see what kinds of pretty things I can come up with!
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #5 on: April 28, 2006, 01:54:07 AM »

Woot

You rock tweak Smiley
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #6 on: April 28, 2006, 04:36:46 AM »

took awhile for me to remove zak's old sky stuff from my game and put in this new one Smiley

Just got it somewhat working,

The sun/moon billboard arent working Sad..

and I get a CRAPLOAD of

04-28-3906 05:34:36 | MATERIAL MANAGER : Couldn't find the material 's' in the material list
04-28-3906 05:34:36 | MATERIAL MANAGER : Couldn't find the material 's' in the material list

It was doing that before, but only twice. Now it does it like 50 times



*Edit*

Oh ya, and it doesnt render my shadows anymore Sad
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
tweakbox
Customers
Community Member
*****
Posts: 1194


« Reply #7 on: April 28, 2006, 07:06:56 AM »

Well, on the machine I tested it with, Zak's original demo gave those material 's' not found errors too.  I know the sun and moon are not working, but I don't really know why right now Wink

I really don't have a clue what the material 's' things are about anyway, because to the best of my knowledge, I never created nor requested any material s in that demo.

As far as shadows not working, well, you've got me there as well  :lol:
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #8 on: April 28, 2006, 04:51:06 PM »

Well,

I found the moon billboard

http://img50.imageshack.us/my.php?image=screenshot9sj.jpg

lol.

It appears it only moves beneath the terrain/skydome... and disappears when it hits the horizon...

Still havent figured out shadows
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #9 on: April 28, 2006, 05:04:50 PM »

I got the moon billboard to render by removing the clouds and the skymesh from the render loop....

weird...
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
tweakbox
Customers
Community Member
*****
Posts: 1194


« Reply #10 on: April 28, 2006, 05:41:42 PM »

actually, that would make sense.  By having the sky re-rendered in the main render loop, it probably over-wrote what happened inside the sky's render function.

But yea, I don't know what could have hapened to your shadows.  Maybe you did something with the view scene's frustum when you changed things over?
Logged

I want to make a puzzle with like 40,000 pieces, and when it's done, it says "Go Outside"
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #11 on: April 29, 2006, 06:50:19 PM »

I got shadows to work again..

But they only work at night.. (weird)...

Now,

04-28-3906 23:00:10 | MATERIAL MANAGER : Couldn't find the material 's' in the material list

Shows up like 20 times a second in the debug.log file...

It spams the hell out of it, so i had to disable the engine log....

Any idea what it could be?
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #12 on: April 29, 2006, 10:50:05 PM »

Don't mind the 's', it's probably some material getting/setting that tweakbox left in his code from the conversion, and which doesn't have its place.
Logged

darqSHADOW
Administrator
Community Member
*****
Posts: 2817


« Reply #13 on: April 29, 2006, 11:29:11 PM »

It looks to me like we missed a % in the debug call, as well.  Wink  It should be printing the material name.

DS
Logged

TrueVision3D Project Manager
The fast and simple way of 3D development.
SylvainTV
Administrator
Community Member
*****
Posts: 4944


WWW
« Reply #14 on: April 30, 2006, 04:33:41 AM »

Actullly no the % isn't missing but...

      AddLog("MATERIAL MANAGER : Couldn't find the material 's%' in the material list", cMaterialName);
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #15 on: April 30, 2006, 04:11:25 PM »

Quote from: "Zaknafein"
Don't mind the 's', it's probably some material getting/setting that tweakbox left in his code from the conversion, and which doesn't have its place.


I cant just not mind it lol.

Cause if i turn on the debug.txt file, all it is , is spam of that cant find material s thing...

and it lags the hell out of the game client cause it adds it several hundred times a second.

It was in the original sky demo too...

both vb and vb.net
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #16 on: May 09, 2006, 01:15:59 AM »

well.. least that was solved with the new dll Smiley

Now, If only shadows could work correctly.....

firstly, the lights in this dont seem to want to cast shadows off foamys rancor... but it casts off everything else..

Also the shadows only work at night... lol...
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Taneas
Customers
Community Member
*****
Posts: 159


« Reply #17 on: May 09, 2006, 01:55:17 AM »

Ok Update...

Got the shadows to work during all times now,

This:
Lights.EnableLight(number, color.a! = 0.0F);

Is supposed to be this:
Lights.EnableLight(number, True)

So now that that works, Theres a new issue Smiley lol
Heres a pic:

http://img213.imageshack.us/my.php?image=wtflol0se.jpg

Check the area circled in red. I have no idea what that is and where its coming from. Its not there with the shadows at night, and ive never seen it before.[/url]
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #18 on: May 09, 2006, 10:12:44 AM »

Known problem...
http://www.truevision3d.com/phpBB2/viewtopic.php?t=12141&highlight=shadows
Logged

Taneas
Customers
Community Member
*****
Posts: 159


« Reply #19 on: May 11, 2006, 01:50:58 AM »

*edit*

had to change

Math.TVVec3Scale(moonPosition, moonPosition, -9000.0F)

to

Math.TVVec3Scale(moonPosition, moonPosition, -7000.0F)
Logged

- Working as Intended -
- FTW Studios Lead Developer -
- www.ftw-studios.com -
Pages: [1] 2 3 ... 5
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks