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.

DarkBASIC Professional Discussion / Scroll texture of textured stages

Author
Message
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 10th May 2015 13:37
command: SCROLL LIMB TEXTURE Object Number, Limb Number, Stage Number, X, Y


Does anyone remember or know, just by chance, with what DBP upgrade this was still working?
I'm on version 1.066 (still) and it does not work.

Thanks in advance
Cheers
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th May 2015 16:19 Edited at: 10th May 2015 16:21
It probably does work - but make sure your object has the assumed UV stage data. There was an old Bug Report (by Dark Coder I think) that forgot that simple requirement.

In other words you cannot scroll the stage 2 UV coordinates if your model only has the default stage 0 UV texture coordinates.

Edit Oops! My comments referred to scroll object texture. I've just noticed that you're talking about the limb version. I'll do some checking now.



Powered by Free Banners
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th May 2015 17:22
OK. Just done some checking and scroll limb texture seems to work as intended.

Here's the test code I used:



Just use your own images and press upkey to scroll the stages on the limb you want (I used stage 1 for limb 0 in the demo above).



Powered by Free Banners
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 11th May 2015 01:27
Always excellent willingness to support GG !

A few comments:
in your code

should be:


If you use :

the 3 mode will grab the UV sets of stage 0 and apply it to stage 1

By using this code without the fvf chunk I can get the same results as by using the fvf chunk.
That should mean that I have a stage 1 in the model already.

But, still,I don't get the desired result. The scroll is OK but the appearance is wrong (bluish).

I think that has to be expected because i put a bumpmap texture in the second stage that will blend with the first one.

Now to the point:

Actually I was playing with your GG bump mapping demos based on shaders

My goal was to get a bump mapped textured object and scroll the limb textures

This doesn't work neither in the -set bump mapping on- case nor in the -set limb effect- case, in both of which, I get the right appearance but lose the scroll.
At least on my side .

I'll attach some code and media in a zip to show what I'm trying to achieve.
Just for sake of completeness to you given your kind attention to my case.
You can rem and unrem the code chunks to see the different behaviours.

Cheers
Scorpyo

Attachments

Login to view attachments
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2015 01:38 Edited at: 11th May 2015 01:44
Thanks for the correction - that was a silly copy and paste error obscured by the fact that the image I used consisted of horizontal lines so the final displayed image was rotated (and I didn't notice that either ).

Interesting you're using shaders and getting a problem. I noticed something like this a while back but found a simple solution. I'll see if I can dig it out as it might be relevant.

Anyway, I'll correct my demo and have a look at yours when I get the chance tomorrow. Too close to midnight for me to try anything clever tonight.

Edit I don't understand this comment of yours:

Quote: "If you use :



the 3 mode will grab the UV sets of stage 0 and apply it to stage 1
"


That doesn't create stage 1 data as far as I know - it just uses the stage 0 data for each stage so you can only scroll both stages at the same time.



Powered by Free Banners
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2015 02:33
Couldn't resist having a look at your code tonight.

In your tank track demo I guess you want both stages to scroll together. In that case you don't need extra UV stage data at all. You only need to scroll the limb texture without reference to stages. I'll check that and see what happens.

The blending version scrolls the texture correctly as far as I can tell - but obviously doesn't have the shader applied so you simply get the two textures multiplied ("modulated") together.

A simple way of getting your demo working is to modify the shader (see attached). Try this code:



I agree there seems to be a problem when you apply the shader and try to scroll the texture using the DBPro commands. Not sure where the problem is exactly - I'll do a bit more investigating tomorrow.

In the meantime the revised snippet and shader should do what you want.



Powered by Free Banners

Attachments

Login to view attachments
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 11th May 2015 09:32
Thanks !!
Your modified version works perfectly.
I can now finally apply selective limb texture scrolling, with bumpmaps applied, on my tracked vehicles.

I'm very thankful for your help.

Cheers
Scorpyo

P.S. I will modify all your other versions of your shaders (GGbump01a.fx, GGbump01c.fx etc..) accordingly, and check out the differencies.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2015 13:07
Quote: "I can now finally apply selective limb texture scrolling, with bumpmaps applied, on my tracked vehicles."


I think you need to apply a separate copy of the shader to each limb before you can do that. At the moment the snippet applies the same shader to each limb so they will both scroll the same way. I guess you'll want to scroll them independently when turning on the spot for example.

Quote: "I'm very thankful for your help."


You're welcome.

Quote: "P.S. I will modify all your other versions of your shaders (GGbump01a.fx, GGbump01c.fx etc..) accordingly, and check out the differencies."


I think those shaders all come from an early demo of mine and some of them contain logic errors and are best forgotten about (I was still learning about shaders when I wrote them). Let me know which features you need and I'll see if I can dig out (or provide ) a relevant updated version.



Powered by Free Banners
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 11th May 2015 13:27
Quote: "
I think you need to apply a separate copy of the shader to each limb before you can do that
"

Exactly , I just tried that on a vehicle model.
I just applied a "static" version of the shader to the vehicle body and the "scroll UV" version to the tracks.
Everything works fine.

Quote: "
I think those shaders all come from an early demo of mine and some of them contain logic errors and are best forgotten about (I was still learning about shaders when I wrote them). Let me know which features you need and I'll see if I can dig out (or provide ) a relevant updated version."


I appreciate the offer but I am still at a very early testing stage with stuff.
Not sure yet what type of effect I will want on the models.
But I'll come back in case I need some support.

Still can't figure out why DBP command Scroll Limb Texture object,limb,stage,U,V can't work.

Thanks again
Cheers
Scorpyo
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2015 13:44
Quote: "Still can't figure out why DBP command Scroll Limb Texture object,limb,stage,U,V can't work."


Neither can I.

It's almost as if the shader overrides certain changes to the object's states. I know the use of a shader overrides DBPro light settings but perhaps this is another instance of the same thing?

Lee might know.

A definitive list of such things would be helpful.

Quote: "Everything works fine."


Great. The next problem is what to do if you have 20 tanks. Do you really want to load 40 copies of the same shader? There are probably some slightly messy ways of dealing with this situation if necessary.

The simple solution would be to have a version of scroll limb texture that works with shaders ...



Powered by Free Banners
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 11th May 2015 14:02
Quote: "
The simple solution would be to have a version of scroll limb texture that works with shaders ...
"


yeah..nail hit !

Luckily I'm after a farm game with old style crawlers (see pic).
There won't be more than 3 or 4 models running at once.

But since the scroll must go by value increase

after a while you gotta reset the value to 0 in order not to reach too high values (but that will take hours) and get into other types of problems.

Cheers
Scorpyo

Attachments

Login to view attachments
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2015 14:15
I guess you won't need many tanks - unless your farm is in the Ukraine ...



Powered by Free Banners
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 11th May 2015 14:18
Lol

Login to post a reply

Server time is: 2025-05-11 05:27:55
Your offset time is: 2025-05-11 05:27:55