Are view entities no longer affected by sunlight?

Posted By: Redeemer

Are view entities no longer affected by sunlight? - 02/10/12 17:17

Hiya,

It seems view entities are no longer affected by sunlight, so they only reflect flat diffuse lighting. The albedo variable seems to have no effect on view entities.

Is this true, or have I done something wrong? If it is true, is there any way I can fix it?

Thanks.
Posted By: Redeemer

Re: Are view entities no longer affected by sunlight? - 02/11/12 18:01

Does no one have an answer to this? I still haven't been able to solve this issue myself.
Posted By: Superku

Re: Are view entities no longer affected by sunlight? - 02/11/12 18:17

Hm I don't know how the lighting used to be or should be from your perspective, but as they are not present in your level, IMO they should not be affected by sunlight. You can check if the sunlight has any influence on your view entities by setting sun_light and similar parameters (in particular the angle) dynamically and assign a material that has sunlight relevant properties set to a high value.
Posted By: Redeemer

Re: Are view entities no longer affected by sunlight? - 02/11/12 18:40

I've tried playing around with the sun variables, but that didn't produce any useful results. View entities don't seem to be affected by sunlight at all, which is strange because they used to be affected in A6.

I suppose I should mention that my project doesn't load WMB levels. I load empty levels (level_load(NULL)) and then populate the world space with entities. I wonder if that makes any difference?
Posted By: Uhrwerk

Re: Are view entities no longer affected by sunlight? - 02/11/12 20:14

The difference is that sun's variables don't get set.

Did you try:
-sun_color
-sun_light
-sun_angle

Did you ensure the view entities material is mtl_model?
Posted By: Redeemer

Re: Are view entities no longer affected by sunlight? - 02/11/12 21:53

Yup, did all that. It makes no difference.

Does anyone have any other suggestions?
Posted By: rojart

Re: Are view entities no longer affected by sunlight? - 02/12/12 10:56

I've noticed the same problem, like code below.

Code:
#include <acknex.h>

function main() {
	
	vec_set(sky_color,COLOR_BLUE);
	video_set(200, 200, 32, 2);
	
	level_load(0);
	
	you = ent_createlayer(SPHERE_MDL,0,5);
	vec_set(you.blue,COLOR_RED);
	you.x = 25;
	
	while(1)	{
		sun_angle.pan += 10 * time_step;
		wait(1);
	}
}


But in A7 works very well:


Posted By: Redeemer

Re: Are view entities no longer affected by sunlight? - 02/12/12 16:02

So I was right after all. Well, that sucks.

I was trying to create some first person weapons for a splitscreen game. I found that I couldn't use level entities since they had to remain invisible on every other view, so I decided to use view entities. But without any lighting, the models look extremely ugly...

Maybe I should try baking some simple "lighting" right onto the model. It's better than nothing, I suppose.
Posted By: Superku

Re: Are view entities no longer affected by sunlight? - 02/12/12 16:13

Why don't you apply a shader then?
This diffuse lighting shader should be pretty much like the default mat_model material: http://www.conitec.net/shaders/shader_work2.htm
You may/ certainly have to replace the sun vectors and variables with custom vectors (that you declare and set in your script).
Posted By: Uhrwerk

Re: Are view entities no longer affected by sunlight? - 02/12/12 16:34

He could use the predefined vectors as well, can't he? He just had to transform them to screen space before, right?
© 2024 lite-C Forums