Jump to content

rd-rend2 (old thread)


eezstreet

Recommended Posts

Posted

Cool, except the rend2 I have no longer works with the most recent OpenJK builds :(

And a tutorial on how to use cubemaps would be very nice

Posted

I guess I can post what I did to get the specular and cube maps working before I disappear unexpectedly again.

 

For cubemaps, you simply place a "misc_cubemap" entity where you want the cube map to be generated. All rendered surfaces use the cubemap that is closest to them. You need to enable it in-game using r_cubeMapping 1.

 

For specular, this is the shader I've been using:

textures/rend2/spec25
{
  qer_editorimage textures/bespin/newfloor
 
  {
    map $lightmap
  }
 
  {
    stage diffuseMap
    map textures/bespin/newfloor
    blendFunc GL_DST_COLOR GL_ZERO
  }
 
  {
    stage specularMap
    map textures/bespin/newfloor_s
    specularReflectance 0.25 // default is 0.04 - non-metallic surface
    specularExponent 8192 // default is 512
  } 
}

The main thing to notice here is the use of 'specularReflectance'. The value here describes the material's refractive index, i.e. how much light is reflected or refracted. For non-metal materials, the default is good. For other types of material, you can look up the refractive index from http://refractiveindex.info.

 

You can also control how much specular specific parts of a texture has by making use of the alpha channel. The value in the alpha channel then gets multiplied by the 'specularExponent' to give the overall shininess of the texture. As you can see from the video, the shininess also makes use of the cube map, so the shinier something is (and the more reflective it becomes), the more visible the reflected scene becomes.

Archangel35757 likes this
Guest KENNITHH
Posted

this is really becoming too good to be true... I think I can mimic graphics like css/cod/bfbc maybe even csgo or BF3 with the right use of this stuff once theres a fork with sof2 compatibility

 

keep up the good work !

Guest KENNITHH
Posted

I know but still, if you see the difference between the default maps and the ones I made, it's already a huge difference, now with this, it will be even more... 

 

Same with Szico's maps, its also a huge difference with the default maps. Might be others too but I only know Szico's map.

 

I actually once made a map and it looked like skyrim but the FPS was so terrible. I also lost a bit of interest in mapping cause of all the restrictions but with this.. I could be back in action ^^

Guest KENNITHH
Posted

Hmm I forgot to ask in my previous posts. Will we be able to add cubemaps to the default maps with .ent files?

Posted

Is there any way to take advantage of rend2's real time shadows (aka the debug feature r_forcesun)? I feel it's kind of painful to have it so close and then be stuck with static lightmaps after all.

 

What I mean is, obviously a map compiled without -light doesn't look good, but forcesun can calculate shadows when brushes move around or when light moves around. For example, some doors I have in a map are dark, but when they swing open they would logically receive light. But, the lightmap is a map.

Posted

If you use the q3gl2_sun keyword, then the sky will cast real-time shadows. You'll need to set r_sunlightMode 1 and r_depthPress 1, both of which are a bit buggy :P I'm not sure about shadows from regular lights just yet.

 

Keep in mind it's all very WIP.

Boothand likes this
Posted

Can someone please verify that adding a .shader / .mtr to an MD3 misc_model / misc_model_static doesn't do anything? Tried to in both rend2 & vanilla renderers, which leads me to think that MD3 has been broken somehow.

 

Also confirm that the MD3 model angle is borked, as in it doesn't face the same way as in radiant/jamp.

Posted
 

Can someone please verify that adding a .shader / .mtr to an MD3 misc_model / misc_model_static doesn't do anything? Tried to in both rend2 & vanilla renderers, which leads me to think that MD3 has been broken somehow.

 

Also confirm that the MD3 model angle is borked, as in it doesn't face the same way as in radiant/jamp.

How are you adding it to the misc_model/misc_model_static?


@@Xycaleth, I still have the issue with the black dots appearing, using that shader. As in this post: http://jkhub.org/topic/2804-rd-rend2/?p=53470

 

Here's the specular map - using a TGA with the same image in the alpha channel, for now: https://dl.dropboxusercontent.com/u/58757568/asphalt_spec.jpg

I'm not sure still. Are you using any other texture maps like parallax or normal maps?

Posted

Nope. This shader. Same thing happens with and without the blendfunc.

 

 

 

textures/bootland/asphalt
{
	qer_editorimage	textures/bootland/asphalt
	{
	map $lightmap
	}
	{
		stage diffuseMap
		map textures/bootland/asphalt
		blendfunc GL_DST_COLOR GL_ZERO
	}
	{
		stage specularMap
		map textures/bootland_nmaps/asphalt_spec
		specularExponent 8192
		blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
	}

}

 

 

Posted

How are you adding it to the misc_model/misc_model_static?

 

I'm loading up an MD3 as you normally would for a misc_model / misc_model_static. The shader should be able to be applied to it, as it works fine in ioquake3. But it's not just the shader issues, it's also the model angle not matching what you see in radiant. It matches fine in jamp.exe though.

Posted

Nope. This shader. Same thing happens with and without the blendfunc.

 

 

 

textures/bootland/asphalt
{
	qer_editorimage	textures/bootland/asphalt
	{
	map $lightmap
	}
	{
		stage diffuseMap
		map textures/bootland/asphalt
		blendfunc GL_DST_COLOR GL_ZERO
	}
	{
		stage specularMap
		map textures/bootland_nmaps/asphalt_spec
		specularExponent 8192
		blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
	}

}

Don't use a blend func for the specular map stage and see how it is.
Posted

Don't use a blend func for the specular map stage and see how it is.

 

 

Same thing happens with and without the blendfunc.

 

:D

 

I'm only using q3map_sunext at the moment, if that matters.

Posted

Try removing map $lightmap, and can you please post your sky shader so I can help you rend2-ify it so you don't need to use r_forcesun 1. :)

 

r_sunlightmode 2 is meant to look dodgy with non rend2 maps according to the documentation, so I'm thinking it means a non rend2 sky shader.

Posted

Try removing map $lightmap, and can you please post your sky shader so I can help you rend2-ify it so you don't need to use r_forcesun 1. :)

 

r_sunlightmode 2 is meant to look dodgy with non rend2 maps according to the documentation, so I'm thinking it means a non rend2 sky shader.

 

It only made it look non-lightmapped and regular.

Yeah, in fact I haven't added any sky to my rend2 shader yet. If this is what has caused all my past problems with silly looking normal maps etc, I apologize :D

 

In any case, here's my current placeholder sky shader, only placed in the vanilla .shader.

 

 

 

textures/bootland/bootsky
{
	qer_editorimage	textures/skies/sky
//		     red green blue intensity degrees elevation deviance samples
	q3map_sunExt 0.869713 1 0.472299 900 30 50 2 16
	surfaceparm	sky
	surfaceparm	noimpact
	surfaceparm	nomarks
	notc
	q3map_nolightmap
	skyParms	textures/skies/bespin 512 -
} 

 

 

Posted
	//q3gl2_sun  <red> <green> <blue> <intensity> <degrees> <elevation?> <deviance?> <shadowamount - 0 too dark, 1 too light>
	q3gl2_sun 240 238 200 50 195 75 3 0.5

	//q3gl2_tonemap <toneMapMin> <toneMapAvg> <toneMapMax> <autoExposureMin> <autoExposureMax>
	q3gl2_tonemap -5 -1.5 0 -2.0 2.0

        q3map_skylight 50 16
        q3map_lightimage $whiteimage

Add in this code, just tweak the values to your liking. ;)

Boothand likes this
Guest
This topic is now closed to further replies.
×
×
  • Create New...