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 / Integrating Evolved Shadow Mapping and Phong Shading

Author
Message
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 24th Apr 2012 12:15
Anyone working with Evolved's Shadow Mapping shader (stand-alone 2D Shadow Mapping demo) will quickly realise its shading limitations. For the uninformed, the shader uses a depth map to determine shadow-casting on the target object; but the lighting/shading of the object itself is handled separately in the Pixel Shader, relying on the Normal Map and the ViewVec/LightVec parameters from the Vertex Shader. The Normal Map is the only texture stage which makes use of these two parameters - everything else is dependent on it.

The problem is the resulting Facet Shading. Facet Shading is obviously gross - specially for animated high-poly characters - and Evolved's shader just doesn't seem to have enough info to apply the necessary smoothing. And no, setting the smoothing in DBPro will not affect the result - lolzorz!

So I spent some time integrating Phong shading into Evolved's Shadow Mapping shader. The code I'm using is ported directly from the Phong shader attached with this post (prepared years ago by Roger Wilco). The trouble is I've run out of TEXCOORDs and I can't get the information I need from the Vertex Shader to the Pixel Shader.


I don't even care about Phong shading necessarily - I just want my models to look more-or-less smooth and leave this gross Facet Shading in the dust! But I feel like I'm going about this entirely the wrong way. Is there some obviously better way of achieving smoothing that I just don't know about yet?

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: 24th Apr 2012 14:30
Quote: "The problem is the resulting Facet Shading."


What do you mean? As long as the original model isn't faceted then Evolved's shader gives smooth shading. Perhaps you could provide a screenshot and highlight the problem you're talking about?
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 24th Apr 2012 16:11 Edited at: 24th Apr 2012 16:21
The attached image of the model is a 1:1 screen-crop of the problem (A). I've included a crop from the DXViewer (D) as I don't think the model is faceted by default. I've also included images of the model using the problem shader, 2D-lit but with no normal mapping (C). And also as the model appears in the corresponding Advanced Lighting demo, using the AL spotlight system (B) just as an example of smoothing and how the model responds to it.

To clarify, I cannot get (A) to looks anything like (B).

The 2D Shadow Mapping demo looks like one of his older demos judging by its layout - but I chose to use it because of its ease of portability with other older shaders. I'm using a bond1 zombie as the test subject because its one of the more complex bone-animated models I had lying around.


EDIT: further note:


The pixel shader here is essentially divided into five parts:

- Base Texture (no modification)
- Normal (modification based on light/view vectors)
- Light (2D projection image)
- Shadowmap (based on depth map, independent of other stages)
- Return (obvious, combines them all)

If I set the return value of the Normal Map to "1" then the affect it has on the base texture is *1, which means no effect. Hence (C) int he attached pic. (C) is still affected by the "light" component, as you'd expect.


EDIT redux!!!: I've included the current pixel shader code to complement my previous edit. As I understand it, the problem is occurring here and not in the vertex shader - but implementing phong would require more info than this pixel shader can receive (no more texcoords!).

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: 24th Apr 2012 18:40
Two brief comments for now.

1.

Quote: "but implementing phong would require more info than this pixel shader can receive (no more texcoords!)."


Forget texcoords for the moment. Precisely what information do you think you need?

2. Your revised shader code has this:



You cannot combine a float3 into a float that way without losing information. In this case your code is the same as:



i.e. the redundant extra two floats, the y and z components, are ignored.

What were you trying to do exactly?
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 25th Apr 2012 03:03 Edited at: 25th Apr 2012 14:56
Ha, yeah that's the fix to Fallout's problem. Shadow artifacts were one of the three big breaking issues I had with this shader (alongside animation and this faceting issue) but that .xyz addition fixes it completely. It used to read the "z" component. If it's only reading the "x" component, I'm fine with that for now and might trim it when I have more time to test. The attached image shows the difference (though my scene is dimly lit, so you have to look close). The problem is displayed on the right - solution on the left. (This is an old issue we used to get in UE3 which we hacked with cubemaps before we figured out the real issue).


But it's irrelevant to the faceting issue because the shadowmapping section of the pixel shader does not determine the ligthing depth of the target model - just the depth of cast shadows from either itself or other objects (which is working fine). The problem occurs in the normal mapping section. I just don't know why. EDIT: actually, I imagine the problem is the normal mapping section simply does not have enough information to calculate averaged normals, hence my (failed) attempts to acquire the appropriate info via the phong shading code...

As far as TEXCOORD info goes, I just wanted to import some info relating to the Normal, Binormal and Tangent values as calculated by the phong shader - but I'm out of space because the shadow mapping shader is already TEXCOORD heavy and the addition of animation code fills up the available slots entirely. Hence, no more TEXCOORDs for the info needed by phong shading. It's a typical problem with phong, apparently. But if there were a different solution, I wouldn't even bother with phong.



EDIT: the phong shader for convenience:

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: 25th Apr 2012 13:39 Edited at: 25th Apr 2012 13:41
I don't understand you at all.

Your "fix" completely breaks Evolved's shadow shader as you should expect. Here are two screenshots of his demo. The top half uses your change, the lower half uses Evolved's original code.



This is the only line changed in the shader:

Attachments

Login to view attachments
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 25th Apr 2012 14:26 Edited at: 25th Apr 2012 14:43
True that. It's been over a fortnight since I ran the raw demo. My change screws it up. What's more is I understand why. And yet, check the previous screenshot I posted - shadowing fine. Why would it shadow properly if, in the raw demo, it's all screwed up? I cannot explain this. It's heartbreaking to discover such a damning flaw after the shader has worked in isolation for so long.

What's worse, reverting to the un-edited shader does not solve the faceting issue. Other shaders don't have this problem with this model. I have also successfully tested other complex bone objects (a bond1 mobzombie) with this shader which do not suffer the faceting issue.

I thought I was getting somewhere. Now I am at a completely loss. If I reframe the problem from scratch, there's now two issues:

A. Shadowing artifacts ala my last screenshot (maybe I'll just shut my big fat mouth and sit quietly in the corner of Fallout's thread?).

B. The facet shading. It affects this model while other similar models are unaffected. But this model works fine with other shaders. And other models work fine with shadow mapping - how am I to know which will work and which won't; or fix it, for that matter?



EDIT: have included a screenshot of the properly shaded model (that's a texture seam in her armpit - not a flaw), oddly with lighting (on the left) and shadowing (on the right) working fine with the "x" addition... Obviously I need to move on from that though, right?

Attachments

Login to view attachments
Irradic
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location:
Posted: 25th Apr 2012 14:29 Edited at: 25th Apr 2012 14:35
I think the problem he is trying to address can be seen in the first image of this screenshot which he has posted earlier.

Smoothing issues on some parts of the mesh, something I have experienced 5 years ago with one of Evolved's shaders (and only with his shader).

The problem was solved after re-exporting with a different exporter. But the exporter isn't the only culprit here, since the mesh had no smoothing issues with other shaders.

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: 25th Apr 2012 14:46
I see. In other words the problem is not "shadows" but "shading". The line that was changed was part of the shadow calculation, not the shading calculation. That was what misled me.

@MMM

I'll have another look at what you're trying to do now that I know it's the shading not the shadows that you're worried about.
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 25th Apr 2012 14:54
Yeah that's the one, Irradic, thanks. The modified line was just part of the shader I was using at the time; it was an addition which had solved one of my big issues - but obviously it is an issue in itself. It's a good thing you pointed it out though, GG - I'll obviously need to look at again. Thanks for spending some time on this.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Apr 2012 14:55 Edited at: 25th Apr 2012 14:56
MMM

I need to see a sample object (email it to me if you prefer). I can't reproduce your problem using simple objects. For example, I've tried replacing Evolved's high poly sphere with a low poly one and I don't see any faceting.

Here's the code change:



Here's a screenshot - no faceting.



My guess is that the faceting is a feature of the object rather than the shader, but till I see one I can only guess.

Don't give up. Misunderstandings happen to all of us.

Attachments

Login to view attachments
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 25th Apr 2012 15:04
Yeah I'm getting the same with the primatives. Also with similar model types (see screenshot in last post).


Email sent. Thanks bud.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Apr 2012 15:18
Quote: "Email sent. Thanks bud. "


Thanks. I've received it and checked it opens OK in DX Viewer. I'll check it out for you immediately after lunch.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Apr 2012 17:21 Edited at: 25th Apr 2012 18:38
Your model seems to be faceted, in other words there aren't any shared vertices. DBPro reports 4208 polygons and 12624 (= 3x4208) vertices. That is probably part of the problem - but if the normals are correct that shouldn't matter. I haven't checked those yet - they could be the problem. The normals need to be computed from a welded version of the model, otherwise each normal at a repeated vertex will have a different value.

Have you tried re-exporting your model using welded vertices? That might fix your problem.

I agree it looks faceted with the shader.

Still investigating - I'll update this post when I've checked a few other things.

Edit Found the problem! You've run into a DBPro bug/limitation. There's nothing wrong with the shader although your problem can probably be fixed in the shader.

When you load the shader, DBPro computes the binormals and tangents which are needed in bump mapping. It does this automatically for you behind the scenes. Your object's normals are correctly smoothed as far as I can see and DBPro probably doesn't touch those. The problem seems to be that DBPro does not smooth the tangents and binormals when it calculates them. With a welded model that wouldn't be a problem. I've just added one of my tangent/binormal fixes to the shader and the problem is very much reduced if not removed. I'll post a complete demo with your object in a few minutes.

Edit2 Just to keep you amused while you wait for the demo:

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: 25th Apr 2012 18:53
Here's the revised demo. I've removed a few textures to keep the size down a bit.

The fix is a simple and crude one so it might be possible to improve on it. Let me know if you have problems with it.

Attachments

Login to view attachments
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 26th Apr 2012 08:53 Edited at: 26th Apr 2012 10:43
Woah! That's a fantastic fix, GG! I've included a screen grab of the result with the propper normalmap to show how well it appears to work. The raw values you used in your fix were the ones I was originally trying to send to the pixel shader - because that's where the phong shader does its calculations. Obviously your fix makes that method redundant. Can't thank you enough.


I've been testing this thing all day now. I'll admit I've come across some issues I haven't seen before (shadowmap section of pixel shader is playing up when the object animates... Something to do with IN.Proj?) but I'm pretty sure this isn't a sideaffect of your fix. The lower pic in the attachment shows the issue just in case it rings any bells.

EDIT FOR ABOVE PARAGRAPH: Yep, I was just being careless with my use of "TempPos" in the following vertex shader coder. Basically I was trying to light the model based on its animated vertexes - not its unanimated "IN.Pos" vertexes - and screwed it up. I just can't visualise the structure of IN.Pos, I guess. The problem remains - but is unrelated to the topic of the thread. Here:





Thanks again!


EDIT: By the way, if you're sure the model itself is faceted, then the AL shaders I used to test it must all contain their own method of fixing this issue - else the issue would have been obvious. Checking it out with the shaders I mentioned in my first post, I can't see anything similar in the code. Is this odd?

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: 26th Apr 2012 12:19
Glad the main issue is resolved.

I'm out most of today but when I get back I'll look into the boned model issue you've noted. I'm not sure off-hand how my fix fits into that. Hopefully there's a simple fix.

Quote: "EDIT: By the way, if you're sure the model itself is faceted, then the AL shaders I used to test it must all contain their own method of fixing this issue - else the issue would have been obvious. Checking it out with the shaders I mentioned in my first post, I can't see anything similar in the code. Is this odd?"


Yes, I wondered about that too. I haven't seen such fixes in Evolved's shaders so perhaps something else is going on. Something else to look into. The model doesn't look faceted unless you need binormals and tangents for something like bump mapping - standard lighting only needs the normals and they are OK in your model. Perhaps the AL vs 2D difference is something to do with that?
Irradic
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location:
Posted: 26th Apr 2012 12:43 Edited at: 26th Apr 2012 13:54
Actually the issue is still present in the advanced lighting normal map shader, as you can see below.



But your fix does remedy this issue



Attachments

Login to view attachments
Irradic
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location:
Posted: 26th Apr 2012 12:44
used for second image above

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: 26th Apr 2012 13:24
Thanks for checking that. I'll wait for MMM to clarify what his problem is exactly.
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 26th Apr 2012 14:08 Edited at: 26th Apr 2012 14:19
Irradic: which DEMO is your shot taken from? The section (B) from the screenshot I posted earlier is from Evolved's Advanced Lighting "Spot Light" demo. As you can see, the model looks fine when using the Advanced Lighting system. The faceting issue only occurred for me while using the model with his 2D Shadow Mapping demo - which uses a radically different shader setup. I haven't been working with this spotlight technique long enough to fully understand the Advanced Lighting version - so I have no idea why this would happen. In any case, the problem with faceting in the 2D Shadow Mapping demo is now solved - far as I can see. By the way, if this model really is faceted to begin with - and I can fix this issue by re-exporting with propper welding - is there a choice import-export program you use for this sort of thing?



My remaining problem is due to adding animation to the shader. The problem occurs even without GG's fix - so it's really not related to the original issue. The fix isn't causing the problem. I only think it's worth mentioning here because the problem area of the pixel shader reads from GG's additional code. Here is a screenshot:





The object is animating. See how his wrists are dark? The light is looking straight at him - his wrists should be lit up! This is happening because the vertex shader is reading from "IN.Pos" rather than from the new position returned by the animation code. So the lighting is applied as if the model were in its static pose. In the included code, using "TempPos" instead of "IN.Pos" to feed the lighting screws up the lighiting entirely (see my last post image attachment). How do I get the new vertex position info to feed correctly into the lighting setup (denoted by OUT.Proj)?


Attachments

Login to view attachments
Irradic
17
Years of Service
User Offline
Joined: 1st Jul 2006
Location:
Posted: 26th Apr 2012 16:07
The example is using a directional light with the normal map shader applied to the object. Usage of spot light, directional light or point light doesn't make a difference here.
Quote: "so I have no idea why this would happen"

The problem and solution are the same as in the shadowmap shader.
Quote: "is there a choice import-export program you use for this sort of thing?"

I'm using Panda and KwXporter for Max, but I don't know if those will be of any use for you. Models with skinning information are hard to fix without destroying the weighting of the vertices.
If you had the source mesh with all its modifiers you could just attempt to re-export them, but I guess the pack only included .x files ?

MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 26th Apr 2012 16:34 Edited at: 26th Apr 2012 16:36
Quote: "The problem and solution are the same as in the shadowmap shader."


That's the odd part. Only because I don't even get the faceting problem with the AL Spot Light demo. Remember also, the Spot Light demo uses the "Spot.fx" shader. I never got that far - but it could be pulling some fullscreen trickery. I just don't know.

Quote: "I guess the pack only included .x files ?"


This is true. And I haven't used panda since college (and student-licenses for max) - good times.

I think both these points show just how important this smoothing fix is. I imagine many shaders could benefit from it - and it sounds like there will be plenty of models out there that need it. I'm only using these stock models as tests for now but I'm a little surprised at the work they require. Part'n'parcel I guess.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Apr 2012 23:26
OK, I'm back now.

Quote: "The problem and solution are the same as in the shadowmap shader."


Depends what you mean by "the same". I haven't studied the code properly yet but my guess is that if you are using a bone version of the shader then you probably need to transform the tangents and binormals in the same way as you transform the normals. My guess is that my fix should be used either at the start or the end of the bone transformation sequence and till I think about it carefully I'm not sure which is the best way to go. Whichever way is required though you will definitely need to transform normals, tangents and binormals in the same way as each other to get sensible bump mapped lighting results.

Hopefully I'll have a definitive answer soon (except it's already late tonight and my brain has an annoying habit of seizing up around midnight ). Tomorrow morning (UK time) will be better.
MMM
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: NSW, Australia
Posted: 27th Apr 2012 15:12 Edited at: 27th Apr 2012 15:13
For anyone following, this line in the vertex shader:



...was giving me shadowing problems when I changed it to this line:



That specific problem was caused because I failed to update the corresponding line in the "DepthMap" technique - stupidly then, the depth map would be reading "IN.Pos" while the normal mapping would be reading "TempPos" - which are completely different vertex positions, throwing the shadows out of whack.

HOWEVER, updating the "In.Pos" values to "TempPos" properly does not solve the wrist-shadowing issue at all. I thought it would - but it doesn't. So the shadowing on the wrists still occurs. Fail!

???
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2012 20:09 Edited at: 14th May 2012 14:27
[Edit: Demo moved to its own thread here:

Shadow Mapping for bone animated models

]
MMM and I have been working over the last fortnight trying to resolve these issues.

I'm pleased to report that we've resolved the main issues. The result is the attached demo which shows shadow mapping for bumpmapped animated boned models plus fog.

The demo uses two shaders - one for boned models, the other for simple objects. On my machine the demo runs at up to 1400 fps (with vsync off - with vsync on I get a steady 60). A comparable unboned shader reduces the fps considerably when vsync is off.

[Technical stuff]Shader connoisseurs might be interested to know the following.

There were two problems developing the shader. The first main one was a new one to me and held us up for quite a while till Lee kindly confirmed what the problem was. When a vertex or pixel shader is compiled by DBPro something called a constant register table is set up. This table contains all the variables that the application - i.e. the DBPro program - has to pass to the vertex or pixel shader. In the case of the boned version of the vertex shader this includes the bone matrix palette which in this demo has size 60. Some of the models we were using needed the full 60. Each entry in the palette requires 16 floats (corresponding to a 4x4 matrix) and each register in the constant table can contain 4 floats. This means that the bone matrix palette used 240 of the available 256 entries in the constant table. The others were needed for things like fog distance, world matrix, view matrix and so on. It turned out we had exceeded the limit of 256 for Shader Model 2 (neither Dark Shader or DBPro gave any warning this was happening). We managed to get around that problem by moving some of the vertex shader code into the pixel shader - that helps because some of the registers are no longer need by the vertex shader and are used by the pixel shader instead where there was plenty of room. We now come to the second problem.

The original version of the shader had a pixel shader near its instruction count limit - and that was exceeded when certain instructions were moved into it from the vertex shader. We were able to overcome that by compiling the shader under Shader Model 3 instead of Shader Model 2. However, not everyone has a GFX card that supports SM2. Since several instructions were consumed by the repeated shadow map samples (needed to soften the shadow edges somewhat) a simple solution was to reduce the number of samples. So the attached demo has two main techniques for shadow mapping: one for SM3 which uses the full 3x3 sampling grid used by Evolved, and one for SM2 which uses a simple triangular sampling pattern.

[End of Technical stuff]

The demo uses dark red fog so you can see it working clearly. Just change the colour to something that suits your taste.

The demo uses two animated boned models - one from the MS DX9 SDK ("tiny.x") and one from an FPSC Model Pack "vikingwarrior1.x". [Note that the latter had to have vertex colour removed so bumpmapping would work - you'll see the file has been renamed "vikingwarrior1nodiffuse.x" for that reason.] Some of you will notice that the sword doesn't have its own bump map - if you know how to fix that easily please let me know.

Move the camera using the mouse to turn and up/down keys to move back and forth.
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 11th May 2012 22:13 Edited at: 11th May 2012 22:21
Quote: "For anyone following"

I don't have much time to follow the thread.

I have no facetting effect in E's shader. What's ur problem?


For GreenGandlaf:
How I can calculate bone palette value for shader? For example, I have 40 bones in my model.

«It's the Shader, shader me this, shader me 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: 11th May 2012 22:35 Edited at: 11th May 2012 22:49
Quote: "I don't have much time to follow the thread."


Quote: "I have no facetting effect in E's shader. What's ur problem?"


I don't have a problem. Your problem is that you haven't read the thread. I'm not here to solve your time management problems for you.

Quote: "How I can calculate bone palette value for shader? For example, I have 40 bones in my model."


DBPro does that for you - just like the matrices World, WorldView, etc.

Edit Actually, my post relates to two different threads and two different problems - both are solved in the demo.

Edit2 here's the other thread:

Fastbone shader tutorial

It's debatable which is the most relevant thread for my latest demo.
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 11th May 2012 22:55
Quote: "I don't have a problem. Your problem is that you haven't read the thread."

That was pointless from me of course not you, and I just wanted short explanation - how does he (MMM) get ugly facetting.

Quote: "DBPro does that for you"

I don't remember exactly, but I must declare palette value somewhere in shader. I don't have bone shaders under my hand, but I'll find example.

«It's the Shader, shader me this, shader me that»
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th May 2012 00:38 Edited at: 12th May 2012 00:38
Quote: "but I'll find example"


You don't have to look far. Try my demo a few posts back.

Or, just look in your DBPro folder if you want a messy way to do it:



Quote: "how does he (MMM) get ugly facetting."


I don't know how he did it, but you can do it yourself easily enough:

Attachments

Login to view attachments
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 12th May 2012 00:49
I don't know if this thread is still active but I don't think there is any issue with the original shader. It's like GG pointed out a few posts back, the tangent and binormals are not being calculated properly for this mesh. This could stem from a number of factors, the Vextex Declaration is not being translated properly from the FVF format that the model is using. You could try to output the tangents and binormals and "look" to see if they appear correctly.

I would suggest that you export with different settings and failing that changing the FVF format so that DBP can construct the proper Vertex Declatation for you mesh/model.

ps. Sometimes you just have to go with SM 3.

Login to post a reply

Server time is: 2024-05-02 00:02:25
Your offset time is: 2024-05-02 00:02:25