Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Cant get 3DGS shaders to go! NOOB or manual at fault... #256406
03/16/09 16:41
03/16/09 16:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I dunno if its the manual or me, but I cant get the built-in 3DSG shaders to work right, specifically specBump.
I used this example IDENTICALLY clipped from the "Predefined Materials" page of the manual like so...
Code:
#include <mtlFX.c>
...
action bumpy_warrior()
{
  my.skill41 = floatv(50);  // facAmbient
  my.skill42 = floatv(50);  // facDiff
  my.skill43 = floatv(50);  // facSpec
  my.skill44 = floatv(50);  // shininess
  my.material = mtl_specBump();
  ...
}
but it wont even compile unless I take the () off the mtl_specBump on the my.material line.
Then it almost works but the skill41 -> skill44 values make no difference, even if I change them and re-compile.
The shader does appear to be active in some way, but muted or failing in some way.

Ive used the wiki specular bump shader by matt with no problems, with the same models and it looks fine.
But I want a more compact code like the spec_Bump of 3DGS looks to be, as it is going onto thousands of entities AT ONCE.

Am I doing something dumb? The above code from the manual is the only code I have inserted in regards to using the shader.
Is there some other shader-initialisation function I need to run in order to get this going, I saw one in the mtlFX.c but
I have no idea if it needs to be run manually, or if it is executed automatically by the shader code somehow.

An answer would help me in my learning, but some links to lite-c tutorials or AUM issue numbers would be greatly appreciated.

Thanks All.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: EvilSOB] #256412
03/16/09 17:32
03/16/09 17:32
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
...One shader is never "perfect" for all scenarios.

Tell us exactly what you need it for, and either me or someone else in this very generous community will make it for you.

1) How many lights?
- a) Sun light
- b) dynamic light
- c) "fake" static light
2) Specularity included?
3) LOD?
4) Etc...


Also, if you haven't already flattened/seperated the faces of your model, post it as well and I'll fix that as well...


xXxGuitar511
- Programmer
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: xXxGuitar511] #256420
03/16/09 18:27
03/16/09 18:27
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
This is my second step into learning shader programming, so this is really just an aid for my learning. I want to get
this 3DGS supplied shader running so I can then start hacking into it to learn.

Then I'll write my own from scratch, cause its going to need a 2 or 3 layers of LOD behaviour. I dont want someone else
to do my work for me, I just want to learn. Starting with simple stuff but not preferrably not too simple.

Like I said, I got the wiki one working fine, and it does work beautifully with my test models, and I could probably
hack the LOD levels into it, but I want a simpler one with normals and lights to study and learn from. Thats why I chose
the 3DGS one, the wiki one is too complex to START learning from, whereas the 3DGS one looks simpler to start with.
If this assumption is incorrect because of the way the 'includes' interact (I have not even looked at them yet),
I'll back out and learn from the ground up. Which I found was the case with the script templates.

Are the 3DGS shaders hideously interwoven in their 'include' usage or are they relatively simple to hack as a learning tool,
or should I focus on one of the simpler specular-normal shaders from the wiki instead?

Thanks.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: EvilSOB] #256430
03/16/09 18:58
03/16/09 18:58
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
...Like I said, I can write you one. Even if it's not for use, you can use it for learning, I'll even throw in comments. I've been using GS for over 5 years now, and shaders are my specialty. I wrote a NM shader a long time ago ( Normal-Mapping Shader (The best at VS/PS 2.0) ).


Shaders are very fun to work with, and will teach you a lot about moddeling and coding. The offer still stands even if just for teaching purposes...


xXxGuitar511
- Programmer
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: xXxGuitar511] #256436
03/16/09 19:47
03/16/09 19:47
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK then, IF it not too much trouble, I'd like the following, so I can learn it like a tutorial.
(assume normal map as skin2 for all shaders, and DONT use structs for passing parameter info yet)

1> A single-pass normal mapping shader using just sunlight.
(please explain here what the difference between "normal", "bump", and "Specular bump" mapping is.
If there is actually a difference, Ive never been clear on that part.)
(if there are significant differences, please supply separate shaders with different versions just for step <1>)


2> The same shader as <1> with 1 dynamic light added in the same pass.

3> The same shader as <2> with 2 more dynamic lights added as a second pass.
(please explain or point to real tutorials/info regarding the variable/compiler settings used in the "pass"
stage of the technique, not counting wiki material as I am still reading that.)


4> The same shader as <3> but using structs to pass parameter info.
(please explain here the concept of the "semantic"'s as used with shaders, this keeps twisting my brain.
Can non-numerically assigned semantics be used? ie "inPosition:POSITION" as opposed to "inPosition:POSITION0"
when accessing global variables across multiple functions? Or are global variables in shaders different in some way)


5> 6> 7> ... Anything "layers" you can think of that may be of interest.

When I say "same shader as <x>", I mean that shader with the new stuff added, rather than a whole new shader.
That way I can see better what is interacting with what, and what stays the same even though a new layer
of complexity has been added. Know what I mean?

HA! You shouldnt have offered to help should you. wink
If this is too much work, I wont be annoyed, as even I can see I am asking for a lot. No hard feelings.

PS: I would STILL like to know the answer to my original post, cause it bugs me not knowing why something doesnt work...



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: EvilSOB] #256443
03/16/09 20:35
03/16/09 20:35
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Normal Mapping: Simply uses a normal map so each pixel has it's own normal. This won't show any depth from angles, but still adds an amazing effect.

Bump Mapping: Same thing, but normal is calculated by shader (slower and pointless)

Specular Bump/Normal: Same as both above, just adding specular highlights. Specular highlights are the reflection of lights on reflective surfaces (sunlight on water)


...I'm working on it now, I'll post it soon...


BTW: I'm trying to write out a file that explains everything. I'm going to use structs anyways, since ... their amazing, that's why.


xXxGuitar511
- Programmer
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: xXxGuitar511] #256451
03/16/09 20:56
03/16/09 20:56
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline OP
Expert

Joined: Feb 2008
Posts: 3,232
Australia
As long as you give me a good explanation of the semantics issue then,
I was hope the step from without-structs to with-structs would help me the idea.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: EvilSOB] #256455
03/16/09 21:18
03/16/09 21:18
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline
Serious User
VeT  Offline
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: VeT] #256473
03/16/09 23:08
03/16/09 23:08
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Ok, not exactly what you wanted, but hopefully useful none the less...

NM.docx


xXxGuitar511
- Programmer
Re: Cant get 3DGS shaders to go! NOOB or manual at fault... [Re: xXxGuitar511] #256474
03/16/09 23:14
03/16/09 23:14
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline
Serious User
VeT  Offline
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
can anybody create a simple level with parallax and upload it somewhere?


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Page 1 of 3 1 2 3

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1