Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Shaders for Advanced Terrain

Author
Message
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Aug 2008 19:17 Edited at: 13th Dec 2008 00:16
I'm updating my old shader demos for Advanced Terrain and hoping to add new ones. So post your comments and requests here.

I'll be posting them here.

Here's a screenshot of the first one. It's an improved seamless version of one posted on david w's ultimate terrain thread:

http://forum.thegamecreators.com/?m=forum_view&t=100645&b=1&p=1



The shader blends four terrain textures together according to the terrain's altitude and slope, and optionally, provides bumpmapping for the four textures. The demo uses four different textures for the terrain: grass, sand, rock and gravel.

The full demo is attached to this post.

The fps is appalling on my old machine but most of you have much faster machines, so feedback on this would be useful.

Here's the screenshot from the second batch of terrain shaders posted on 12 August a few posts down. This one just applies diffuse lighting to AT using four different methods in a shader.



Here's a screenshot from the misty fog with terrain demo posted on 19 August 2008.



I've just uploaded a screenshot and demo of a self-shadowing shader for Advanced Terrain - see my posts on 12 December 2008.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Aug 2008 19:18 Edited at: 12th Aug 2008 20:58
First screenshot attached. [Edit: reduced the size of the image somewhat.]

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Aug 2008 19:57
glorius work as always gandalf
iam glad that we have you around to give us these fine snippets.
cheers
The Heavy
16
Years of Service
User Offline
Joined: 6th Aug 2008
Location:
Posted: 11th Aug 2008 20:46
the fps of 2 isn't very encouraging

Who touched my gun?
Alucard94
17
Years of Service
User Offline
Joined: 9th Jul 2007
Location: Stockholm, Sweden.
Posted: 11th Aug 2008 21:28
Yeah the 2 FPS thing is kind of disturbing Although that does look incredible, I've gotta admit.


Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 11th Aug 2008 22:09
That's pretty cool. Are we allowed to use the shader for our own projects?

And if you want to know my fps...

I got 115 fps with no bumpmapping and 60-70 fps with bumpmapping, on my NVIDIA Geforce 8600 GT.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Aug 2008 22:23
bare in mind that this screen does show the whole terrain so it dosent save fps by culling the terrain down as when you use it in an game.
as you then mostly dont see the whole terrain.
you can yust make an matrix with alot of tiles and position the camera the same as the screenie and the fps will not be that good for that either.
and as gandalf says his computer aint that good
revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 11th Aug 2008 23:48
Hi GG,
Good to see your thread is up so soon.

As Cliff Mellangard 3DEGS said, birds-eye views can eat up the FPS. In the starting position (with bumpmapping turned on) I get ~285FPS, but on the ground I get between 550 and 665FPS.

Thanks again for this great example, and feel free to distribute that normal map if you like.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 12th Aug 2008 00:47
Quote: "The fps is appalling on my old machine but most of you have much faster machines, so feedback on this would be useful. "

I'm guessing he's using his old machine, and thus the FPS is appalling?

Anyway, looking good

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Aug 2008 01:39
Quote: "I'm guessing he's using his old machine, and thus the FPS is appalling?"


Well spotted.

Not only is my machine old, it's dying. Sad thing is, I'll cry when it finally dies ...

Quote: "Thanks again for this great example, and feel free to distribute that normal map if you like."


Thanks. I'll be posting the example you helped test for me as soon as I've got my other terrain normal map de-bugged. I've got a few other demos nearly ready too.

Seriously though, don't take much notice of the fps in my screenshots my PC IS OLD.

Quote: "That's pretty cool. Are we allowed to use the shader for our own projects?"


Yes, any shader I post here is free for anyone to use without restriction (as long as it's legal ).
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 12th Aug 2008 03:00
Quote: "Yes, any shader I post here is free for anyone to use without restriction (as long as it's legal ). "


Thanks and of course it is perfectly legal.


I may use it in the OMMORPG Project (sig) if the other team members want to use it.

Thanks again for the shader

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 12th Aug 2008 08:03 Edited at: 12th Aug 2008 08:03
Wow, this is great, I'll look into using this for PoPR.
I get upwards of 300FPS.


draknir_
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 12th Aug 2008 12:17
Hey Green Gandalf,
Looking fantastic as usual. I get 46fps in the air 61 on the ground (bumpmapping on, geForce 8400M). I was wondering if you could find time to make your fog shader compatible with AT (or even better, with this shader ).
regards
Draknir
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Aug 2008 13:43
Quote: "I was wondering if you could find time to make your fog shader compatible with AT"


I think I already have somewhere. No idea where though.

That's obviously a good candidate for updating and inclusion on this thread. [When I've found it of course.]

Quote: "or even better, with this shader"


I'd probably get 0 FPS. Food for thought though.

Quote: "Wow, this is great, I'll look into using this for PoPR."


I'd be very pleased if you do - PoPR is just the sort of game that this shader was designed for. Let me know if you have any problems implementing it - the demo doesn't explain many of the details.
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 12th Aug 2008 17:50
omg! thank you! i've been waiting for a really good example of shadered advt like this for a long time! great work!

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 12th Aug 2008 18:29 Edited at: 12th Aug 2008 18:30
no no gil dont improve your project with an glorius terrain too.
your project looks great already
yust as an reminder i was trying to be funny
cant wait to se gils project with an terrain like this

gandalf cant you put your shader samples you do to the tgc codebas so its easy to find if you nead them ?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Aug 2008 21:08 Edited at: 14th Aug 2008 19:04
Here's another demo giving four ways of applying diffuse lighting to Advanced Terrain. It uses the basic AT idea of two blended textures but adds real time diffuse lighting and/or bumpmapping. Screenshot of one technique attached to next post, displayed in first post.

I'd welcome some feedback on the performance of this second shader. The fourth technique often gives very strange image quality on both my PC and laptop, but other times it works fine. It would be useful to hear of anyone else having similar problems with it. [ Edit Problem solved thanks to Paul Johnston of TGC. The tangents and binormals needed to be calculated in the shader itself. Revised demo now uploaded. ]

The images are not so dramatic as the first one - but a lot depends on the quality of the textures used. I was a bit lazy with this one.

Edit Shader debugged and demo replaced with corrected version.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Aug 2008 21:09 Edited at: 13th Aug 2008 00:12
Second screenshot attached (displayed in first post).

Quote: "gandalf cant you put your shader samples you do to the tgc codebas so its easy to find if you nead them ?"


Good suggestion.

Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 13th Aug 2008 20:51 Edited at: 13th Aug 2008 20:51
Nice one GG! I like the dynamic shadowing with the normal map One thing though. My compiler doesn't seem to recognize when you do stuff like this:



I need to move it all to one line. Is this a feature of later versions of DBP or something? I use v6.6.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Aug 2008 21:33
It's the default line concatenation symbol used in the Editor that comes with DBPro - I still use it.

Replace ... with whatever symbol(s) your editor uses to join lines together into a single command.

Did all four techniques work consistently for you? And what fps did you get?
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 13th Aug 2008 21:47 Edited at: 13th Aug 2008 21:48
Oh I had no idea that was a line break in the default IDE. I'll be sure to open your projects using it from now on

All four worked consistently for me yes. The shadows on the fourth one would go from being really soft to being blotchy, then back to soft again. Not sure if that's supposed to happen. See the attached screenshot for details (left= shortly after "blotchy" section (soft), right=blotchy section). It's a jpeg...

I got about 395 fps when I removed the cap. Nice job

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Aug 2008 01:42
Quote: "The shadows on the fourth one would go from being really soft to being blotchy, then back to soft again. Not sure if that's supposed to happen."


That's what I get unfortunately too.

You are not supposed to get the blotchy effect - and sometimes on my machine it's even worse. The left-hand image in your screen shot is more or less what it should look like. With the "flat" normal map, techniques 2, 3 and 4 should look much the same - all with gradual changes in the shading.

I'm a bit baffled at the moment - but at least it isn't just my machines. Normal bump mapping usually works without problem, I'll have to do some more delving and experimenting.

Thanks for testing it for me - your feedback is extremely helpful.
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 14th Aug 2008 01:54 Edited at: 14th Aug 2008 01:55
Please put the files into a folder before zipping them up! All over my desktop!

Anyways, looks great. Doesn't work for me thougn. I have problems with these lines:



What are min and max? DBP does not recognize them, and you don't have those functions in your code either.

Ben Johnson
17
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 14th Aug 2008 06:54
I am guessing their something similiar to the ceil and floor commands?
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 14th Aug 2008 13:09
min and max just return the lowest and heighest of the two numbers you give them, so you can easily write your own functions. Or, you could download IanM's plugin pack

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Aug 2008 14:04
Quote: "What are min and max? DBP does not recognize them, and you don't have those functions in your code either. "


Yes, sorry. Diggsey is correct - they are from IanM's plug-in. I forgot to warn you all. (But, as Diggsey says, it is easy to write your own.)

Any more feedback on the quality of the fourth technique? I need to go through the code very carefully to see if there is something silly I've overlooked.

Ideas anyone?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Aug 2008 19:09
Quote: "I need to go through the code very carefully to see if there is something silly I've overlooked.

Ideas anyone? "


Paul Johnston found the error - the tangents and binormals needed to be calculated in the shader. Demo replaced with revised version in my 12 August post.

I'll have to check some of my other demos to see if the same problem and solution apply.

Thanks Paul.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Aug 2008 20:13 Edited at: 20th Aug 2008 14:48
Here's a re-worked version of my dynamic misty smoky fog shader for Advanced Terrain.

It's still being worked on so feedback would be appreciated. I've noted a few comments of my own in the dba file.

Screenshot in next post.

[Edit: merely tidied up the demo and shader code a bit. Functionality unchanged.]

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Aug 2008 20:15
Screenshot of misty fog shader with AT.

Attachments

Login to view attachments
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 20th Aug 2008 11:09 Edited at: 20th Aug 2008 11:18
Ah, thanks, fixed it. This is really neat! Runs over 200 fps. I would probably use this if I wasn't using blender terrains.


Wow! The fog is just amazing! Can it be used in a commercial project of mine? And more importantly, does it work on advanced terrain only?

Oh yeah, can you slow down the fog?

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Aug 2008 13:15 Edited at: 20th Aug 2008 14:51
Uncle Sam

Quote: "Wow! The fog is just amazing!"


Thanks!

Quote: "Can it be used in a commercial project of mine? "


Yes - as long as you acknowledge the source and let me know you've done it.

Quote: "And more importantly, does it work on advanced terrain only?
"


The demo consists of two shaders - one for advanced terrain and one for other objects but both shaders do the same thing really. With a bit more work I could have put it all into one shader - but then the texture stages would have got a bit messy. The shaders may need minor tweaking if your objects have other textures assigned to some texture stages, i.e. things like light or specular maps. So the answer is "no" really.

Both shaders have tweakable constants such as "fogNoiseScroll" whose value is set each sync in the calling dba code. The speed in the X and Y directions is set in the following part of the dba code:



This can't be changed at run-time in the existing demo - but you can add it easily enough by adding a bit to the following subroutine in, I hope, the obvious way:



Any more questions, just ask.

[Edited typos. ]
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 20th Aug 2008 23:51 Edited at: 20th Aug 2008 23:53
Quote: "Yes - as long as you acknowledge the source and let me know you've done it."


Thanks! i'll let you know....if I ever get to that point.

Quote: "The demo consists of two shaders - one for advanced terrain and one for other objects but both shaders do the same thing really. With a bit more work I could have put it all into one shader - but then the texture stages would have got a bit messy. The shaders may need minor tweaking if your objects have other textures assigned to some texture stages, i.e. things like light or specular maps. So the answer is "no" really."


I have this blender terrain I made. It may be a problem because I use blend mapping on it, but I'll have to try and see. I noticed that the cubes have some kind of bump mapping on them. Is this a requirement for the fog to work?

Thanks for all the info. I actually figured out how to slow down the fog right after I asked, but forgot to edit it. It's a great shader because you can change so many variables.

After I try it out on my terrain I'll let you know.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Aug 2008 00:47
Quote: "I have this blender terrain I made. It may be a problem because I use blend mapping on it, but I'll have to try and see. I noticed that the cubes have some kind of bump mapping on them. Is this a requirement for the fog to work?"


Not at all. The blocks were bump mapped purely to show you could combine the fog and bumpmapping effects. The blocks were rendered using the non-AT version of the shader ("GG Misty Smoky Fog V3.fx") - and if you study the shader code you'll see it has four techniques but the dba code uses only three of them, i.e. "fogBump" for the bumpmapped blocks, "fogDiffuse" for the sea and "fogSky" for the sky box. The terrain is rendered using the "fogDiffuse" technique of the AT version of the shader ("GG Misty Smoky Fog For AT V3.fx") but I could have bumpmapped that as well using the "fogBump" technique (note to self - did I test that option? ). The various techniques in the two shaders calculate the fog in the same way - with the exception of the one used for the skybox which assumes that the sky is always a fixed distance from the viewer. I could have used some other combinations - for example I could have bumpmapped the sea by using the "fogBump" technique plus a suitable bump map applied to Stage 3.

If you plan to apply the shader to objects with other textures applied to various texture stages, the main thing to remember is that DBPro requires the textures declared in the shader to match the stages used in DBP in the same order. So, for example, the non-AT version of the shader expects objects to be textured with four textures as follows:

Stage 0 - the object's main texture
Stage 1 - the pre-calculated "averageFog" texture (this is faster and more accurate than doing the calculation in the shader)
Stage 2 - the "noise" texture which introduces cloudy variation into the fog
Stage 3 - the object's normal map

If an object isn't bumpmapped you'd just leave stage 3 untextured (stage 4 for the AT version).

If you had an object with another texture on stage 1, a lightmap for example, then you would need to move the above stages 1 to 3 up one and also insert an extra declaration into the shader in the right position (even if you didn't use it).

There are other things you might need to do depending on your object and what you want to do with it - but the bottom line (in DBP) is that the DBP stages must line up with the order of texture declarations in the shader, so if you apply a texture to, say, stage 2 in DBP then that texture must be the third one declared in the shader.
draknir_
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location: Netherlands
Posted: 21st Aug 2008 15:54
Hey GG,
I just tested the AT version you posted and it works fantastic! It's fast and good looking. I'll be implementing it into my project as soon as possible. If I run into anything I'll let you know, but for now all I can say is great work, I love it.
cheers,
Draknir (Casper)
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 5th Sep 2008 22:58
Ok, I have a little problem with my blender terrain (and sky):



nackidno
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Där solen aldrig skiner
Posted: 6th Sep 2008 10:47 Edited at: 6th Sep 2008 10:47
nevermind

- Elias, Damezean, Nackidno, Wonderboy

AntocGames - http://antocgames.se.nu/
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Sep 2008 12:43
Uncle Sam

Quote: "Ok, I have a little problem with my blender terrain (and sky):"


I think I know what the problem is. Could you post or send me a simple demo illustrating the problem? I think it is to do with having vertex diffuse colours in your object's FVF. Some of my demos have that removed, others don't, the two cases need to be handled differently. I need to add some explanation of this point to my original post.

If you can send a demo I'll look at it over the weekend.
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 12th Sep 2008 21:04 Edited at: 12th Sep 2008 21:47
Sure! I'll pack one up....

EDIT: here it is, thanks!

When I remove the detail code (that details the terrain with a detail texture), it works, but the sky ahs the same problem and I have no detail effects on that!

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Sep 2008 12:32
OK, I've downloaded and run it and it shows the symptoms clearly. I'll investigate later today hopefully.

I'm fairly sure I can fix it because I've had similar problems before myself. [famous last words ... ?]
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Sep 2008 13:01 Edited at: 13th Sep 2008 14:55
Terrain seems OK now. I've deleted the diffuse component of the terrain object (why did you add that?).

I replaced this line



with this



See attached screenshot.

I'll look at the problems with the sky and the foreground later. (I suspect the foreground problem is a result of the camera position - not sure till I check).

Edit

Just tested the sky object on its own without a shader and it seems as if (1) it is upside down and (2) the "sky" and "ground" images (i.e. "6.bmp" and "5.bmp") have been swapped. Also, its UV coords are rather strange - the negative values in the X file have been clamped to 0 by the shader. I've tried using your sky images (converted to *.png files) with the "skybox2.x" model from my demo (I think that came from the DBPro Advanced Terrain Example1 demo - but I've probably fiddled with it) and things look much better. I also raised the camera position and tweaked a few other things. I've marked the important changes. Screenshot in next post. There are still some problems with the terrain - there are black holes in it. Here's the code I used:

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Sep 2008 14:56
Second screenshot for previous post.

Attachments

Login to view attachments
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 13th Sep 2008 16:10 Edited at: 13th Sep 2008 16:11
Hi
Just downloaded and compiled, but I got the errors attached. Having rem`d various lines out I got it to compile and run. The lines and which of the two errors in the attached images are detailed in the text document also attached. I`ve tried compiling under 6.7(last good working version?) and 7 (all beta versions), what version are you using so I can change mine? Btw looks pretty neat from what I could see.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Sep 2008 16:20
I think that error means you haven't got IanM's plug-ins. The only functions from the plug-in I use in those demos are min() and possibly also max(). I assume you know how to code that yourself - if not post back.

I'm still using U6.8 by the way.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 13th Sep 2008 18:23
Thanks GG, I`d removed the plug-ins previously as a large number of variables in a previous project contained max in them, causing problems. Works now, thanks
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 18th Sep 2008 04:46 Edited at: 18th Sep 2008 04:47
Sorry I forgot about this! Thanks so much Gandalf. I can try to resolve the remaining issues myself. I don't know really anything about object FVF, so that's just some code I borrowed from someone else. That's why there was some diffuse code there.

Thanks!

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2008 12:33
Quote: "I don't know really anything about object FVF, so that's just some code I borrowed from someone else. That's why there was some diffuse code there. "


Yes, I really need to add a bit of explanation about that issue in the first post. Thanks for the feedback. Post back if you get stuck again.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 28th Oct 2008 20:58 Edited at: 28th Oct 2008 20:59
In the shader attached to the first post, you use the names detailMap1-4 and normalMap1-4 for the textures.

How do these get filled with the textures from stages 1 through 8? Does DBPro automatically fill the first 8 textures for you?

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Oct 2008 12:15
Hi Diggsey.

Yes, the textures are assigned in the order they are declared in the shader. For example, the DBP dba code has the following:



and the fx file has



The image applied to stage 0 in DBP will correspond to the first texture declaration in the shader, i.e. detailMap1, and so on down to stage 7 which will correspond to normalMap4.

I believe that the situation in C++ is different - textures can be matched by name which is obviously better. But i don't know for sure.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Oct 2008 15:59
Thanks. In C++ I think that they can be assigned however you want (eg. the C++ program can do it by index, by name, or however it wants)

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Oct 2008 13:45
I thought that might be the case. Thanks.

Login to post a reply

Server time is: 2024-11-24 15:01:57
Your offset time is: 2024-11-24 15:01:57