Jump to content

  • Log In with Google      Sign In   
  • Create Account


Xoliul

Member Since 20 Feb 2008
Offline Last Active May 24 2012 12:31 PM

Posts I've Made

In Topic: Compiled Shader looks different

24 May 2012 - 12:34 PM

I've found the culprit. Looks like when I add a texcoord input from the application, it breaks the entire thing.

Basically:

// input from application
struct a2v
{
float4 position  : POSITION;
};
// output to fragment program
struct v2f
{
	    float4 position	  : POSITION;
	    float4 wposition	  : TEXCOORD0;
};

to this:

// input from application
struct a2v
{
float4 position  : POSITION;
half2 texCoord  : TEXCOORD0;
};
// output to fragment program
struct v2f
{
	    float4 position	  : POSITION;
	    half2 texCoord			 : TEXCOORD0;
	    float4 wposition	  : TEXCOORD1;
};

In Topic: Compiled Shader looks different

24 May 2012 - 11:23 AM

Hey Ashaman, I guess that's me yes hah. I've tried using the /LD switch but I didn't fix things. I did so many different compiles with different options so i can't remember what was wrong.

I've progressed a bit, I'm basically re-building the code step by step, compiling it again and again and so far it has worked fine. I think I'm 85% of the way and it is working. I'm not even using the /LD switch at the moment.

In Topic: Speed up shader compilation (HLSL)

22 May 2012 - 10:45 AM

I'm only talking from 3DS Max experience here, but it works fine with Max' DXSAS compiler. So it's not exactly true that this isn't possible in general.
Have you looked at the example? I can't tell you for sure if it will work in the Xray engine, I don't know what you have tried exactly so far, but it might be worth the try to create a very simple shader and then compile an ASM version to see if the engine will take it.

BTW, I'm curious what you are doing exactly in your shader that is so heavy and improves the quality so drastically?

In Topic: Speed up shader compilation (HLSL)

22 May 2012 - 08:29 AM

This is a long shot, but what about doing a "hybrid" precompiled version?
Here's an example from someone that's been doing that for 3DS Max for a long time: http://www.poopinmymouth.com/3d/sdk/agusturinn-shader.zip
It basically means you replace the actual vertex- and pixelshaders with compiled asm code, and then feed the variables back in as PixelShaderConstants and the like. (3DS Max requires this or you can't interface with it)

I'm looking into this as well as i've got a 10-minute compile in 3DS Max, while the (incomplete) hybrid precompiled version loads instantly.

It's a bit annoying to generate, I'm trying to contact the author of that example to see if he has a better way than manually doing it (which is a bunch of mindless copy paste work).

PARTNERS